/********************************************/
/*                                          */
/*        Copyright (c) 2018 Aostar         */
/*        @author bgu, pgao, zyang          */
/*        @version 2.2			            */
/*                                          */
/********************************************/

var AostarJS = AostarJS || (function (Math, undefined) {
  var C = {};
  var eD = C.jh = {};
  var Base = eD.Base = (function () {
    function F() {};
    return {
      extend: function (iR) {
        F.prototype = this;
        var ii = new F();
        if (iR) {
          ii.ps(iR);
        }
        if (!ii.hasOwnProperty('ej')) {
          ii.ej = function () {
            ii.sf.ej.apply(this, arguments);
          };
        }
        ii.ej.prototype = ii;
        ii.sf = this;
        return ii;
      },
      create: function () {
        var oy = this.extend();
        oy.ej.apply(oy, arguments);
        return oy;
      },
      ej: function () {},
      ps: function (kH) {
        for (var propertyName in kH) {
          if (kH.hasOwnProperty(propertyName)) {
            this[propertyName] = kH[propertyName];
          }
        }
        if (kH.hasOwnProperty('toString')) {
          this.toString = kH.toString;
        }
      },
      clone: function () {
        return this.ej.prototype.extend(this);
      }
    };
  }());
  var et = eD.et = Base.extend({
    ej: function (cA, fI) {
      cA = this.cA = cA || [];
      if (fI != undefined) {
        this.fI = fI;
      } else {
        this.fI = cA.length * 4;
      }
    },
    toString: function (vN) {
      return (vN || gJ).stringify(this);
    },
    concat: function (ep) {
      var mB = this.cA;
      var nx = ep.cA;
      var lH = this.fI;
      var od = ep.fI;
      this.eE();
      if (lH % 4) {
        for (var i = 0; i < od; i++) {
          var sm = (nx[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
          mB[(lH + i) >>> 2] |= sm << (24 - ((lH + i) % 4) * 8);
        }
      } else if (nx.length > 0xffff) {
        for (var i = 0; i < od; i += 4) {
          mB[(lH + i) >>> 2] = nx[i >>> 2];
        }
      } else {
        mB.push.apply(mB, nx);
      }
      this.fI += od;
      return this;
    },
    eE: function () {
      var cA = this.cA;
      var fI = this.fI;
      cA[fI >>> 2] &= 0xffffffff << (32 - (fI % 4) * 8);
      cA.length = Math.ceil(fI / 4);
    },
    clone: function () {
      var clone = Base.clone.call(this);
      clone.cA = this.cA.slice(0);
      return clone;
    },
    random: function (sv) {
      var cA = [];
      for (var i = 0; i < sv; i += 4) {
        cA.push((AostarJS.dX.iK.js() * 0x100000000) | 0);
      }
      return new et.ej(cA, sv);
    }
  });
  var il = C.dX = {};
  var iK = il.iK = {
    js: function () {
      var n = 0xefc8249d;
      var data = new Date().getTime().toString();
      for (var i = 0; i < data.length; i++) {
        n += data.charCodeAt(i);
        var h = 0.02519603282416938 * n;
        n = h >>> 0;
        h -= n;
        h *= n;
        n = h >>> 0;
        h -= n;
        n += h * 0x100000000;
      }
      while (true) {
        var vB = new Date().getTime().toString();
        if (vB != data) {
          return (n >>> 0) * 2.3283064365386963e-10;
        }
      }
    }
  };
  var gJ = il.gJ = {
    stringify: function (ep) {
      var cA = ep.cA;
      var fI = ep.fI;
      var pp = [];
      for (var i = 0; i < fI; i++) {
        var nd = (cA[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
        pp.push((nd >>> 4).toString(16));
        pp.push((nd & 0x0f).toString(16));
      }
      return pp.join('');
    },
    parse: function (fu) {
      var fR = fu.length;
      var cA = [];
      for (var i = 0; i < fR; i += 2) {
        cA[i >>> 3] |= parseInt(fu.substr(i, 2), 16) << (24 - (i % 8) * 4);
      }
      return new et.ej(cA, fR / 2);
    }
  };
  var rc = il.rc = {
    stringify: function (ep) {
      var cA = ep.cA;
      var fI = ep.fI;
      var qo = [];
      for (var i = 0; i < fI; i++) {
        var nd = (cA[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
        qo.push(String.fromCharCode(nd));
      }
      return qo.join('');
    },
    parse: function (qz) {
      var qp = qz.length;
      var cA = [];
      for (var i = 0; i < qp; i++) {
        cA[i >>> 2] |= (qz.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
      }
      return new et.ej(cA, qp);
    }
  };
  var eN = il.eN = {
    stringify: function (ep) {
      try {
        return decodeURIComponent(escape(rc.stringify(ep)));
      } catch (e) {
        throw new Error('Malformed UTF-8 data');
      }
    },
    parse: function (sO) {
      return rc.parse(unescape(encodeURIComponent(sO)));
    }
  };
  var iX = eD.iX = Base.extend({
    reset: function () {
      this.hG = new et.ej();
      this.rF = 0;
    },
    mn: function (data) {
      if (typeof data == 'string') {
        data = eN.parse(data);
      }
      this.hG.concat(data);
      this.rF += data.fI;
    },
    kq: function (vG) {
      var data = this.hG;
      var hQ = data.cA;
      var pY = data.fI;
      var eB = this.eB;
      var mk = eB * 4;
      var lq = pY / mk;
      if (vG) {
        lq = Math.ceil(lq);
      } else {
        lq = Math.max((lq | 0) - this.pH, 0);
      }
      var lD = lq * eB;
      var sT = Math.min(lD * 4, pY);
      if (lD) {
        for (var offset = 0; offset < lD; offset += eB) {
          this.pM(hQ, offset);
        }
        var tq = hQ.splice(0, lD);
        data.fI -= sT;
      }
      return new et.ej(tq, sT);
    },
    clone: function () {
      var clone = Base.clone.call(this);
      clone.hG = this.hG.clone();
      return clone;
    },
    pH: 0
  });
  var jj = eD.jj = iX.extend({
    cw: Base.extend(),
    ej: function (cw) {
      this.cw = this.cw.extend(cw);
      this.reset();
    },
    reset: function () {
      iX.reset.call(this);
      this.ql();
    },
    update: function (kl) {
      this.mn(kl);
      this.kq();
      this.hG = eN.parse(kl);
      return this;
    },
    hU: function (kl) {
      if (kl) {
        this.mn(kl);
      }
      var hash = this.lM();
      return hash;
    },
    eB: 512 / 32,
    pO: function (nD) {
      return function (message, cw) {
        return new nD.ej(cw).hU(message);
      };
    },
    ru: function (nD) {
      return function (message, key) {
        return new kP.qs.ej(nD, key).hU(message);
      };
    }
  });
  var kP = C.gV = {};
  return C;
}(Math));
if (typeof QMX == "undefined" || !QMX) {
  var QMX = {};
}
QMX.namespace = function () {
  var a = arguments,
    o = null,
    i, j, d;
  for (i = 0; i < a.length; i = i + 1) {
    d = ("" + a[i]).split(".");
    o = QMX;
    for (j = (d[0] == "QMX") ? 1 : 0; j < d.length; j = j + 1) {
      o[d[j]] = o[d[j]] || {};
      o = o[d[j]];
    }
  }
  return o;
};
QMX.log = function (tL, ty, src) {
  var l = QMX.widget.wS;
  if (l && l.log) {
    return l.log(tL, ty, src);
  } else {
    return false;
  }
};
QMX.wr = function (name, kL, data) {
  var pe = QMX.fZ.sg,
    m, v, b, ls, i;
  if (!pe[name]) {
    pe[name] = {
      tS: [],
      tp: []
    };
  }
  m = pe[name];
  v = data.version;
  b = data.ro;
  ls = QMX.fZ.qb;
  m.name = name;
  m.version = v;
  m.ro = b;
  m.tS.push(v);
  m.tp.push(b);
  m.kL = kL;
  for (i = 0; i < ls.length; i = i + 1) {
    ls[i](m);
  }
  if (kL) {
    kL.VERSION = v;
    kL.yb = b;
  } else {
    QMX.log("kL is undefined for vL " + name, "warn");
  }
};
QMX.fZ = QMX.fZ || {
  sg: [],
  qb: []
};
QMX.fZ.xp = function (name) {
  return QMX.fZ.sg[name] || null;
};
QMX.fZ.vY = function (rZ) {
  var ib = function (s) {
      var c = 0;
      return parseFloat(s.replace(/\./g, function () {
        return (c++ == 1) ? '' : '.';
      }));
    },
    nav = navigator,
    o = {
      sa: 0,
      opera: 0,
      pI: 0,
      webkit: 0,
      vh: 0,
      kR: null,
      rO: 0,
      uY: 0,
      tw: 0,
      tn: 0,
      tc: null,
      rv: 0,
      vb: 0,
      wM: nav && nav.wK,
      secure: false,
      pl: null
    },
    ua = rZ || (navigator && navigator.userAgent),
    qV = window && window.location,
    href = qV && qV.href,
    m;
  o.secure = href && (href.toLowerCase().indexOf("https") === 0);
  if (ua) {
    if ((/windows|win32/i).test(ua)) {
      o.pl = 'windows';
    } else if ((/macintosh/i).test(ua)) {
      o.pl = 'macintosh';
    } else if ((/rhino/i).test(ua)) {
      o.pl = 'rhino';
    }
    if ((/KHTML/).test(ua)) {
      o.webkit = 1;
    }
    m = ua.match(/AppleWebKit\/([^\s]*)/);
    if (m && m[1]) {
      o.webkit = ib(m[1]);
      if (/ Mobile\//.test(ua)) {
        o.kR = 'Apple';
        m = ua.match(/OS ([^\s]*)/);
        if (m && m[1]) {
          m = ib(m[1].replace('_', '.'));
        }
        o.tc = m;
        o.uY = o.tn = o.tw = 0;
        m = ua.match(/iPad|iPod|iPhone/);
        if (m && m[0]) {
          o[m[0].toLowerCase()] = o.tc;
        }
      } else {
        m = ua.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/);
        if (m) {
          o.kR = m[0];
        }
        if (/webOS/.test(ua)) {
          o.kR = 'WebOS';
          m = ua.match(/webOS\/([^\s]*);/);
          if (m && m[1]) {
            o.vb = ib(m[1]);
          }
        }
        if (/ Android/.test(ua)) {
          o.kR = 'Android';
          m = ua.match(/Android ([^\s]*);/);
          if (m && m[1]) {
            o.rv = ib(m[1]);
          }
        }
      }
      m = ua.match(/Chrome\/([^\s]*)/);
      if (m && m[1]) {
        o.vh = ib(m[1]);
      } else {
        m = ua.match(/AdobeAIR\/([^\s]*)/);
        if (m) {
          o.rO = m[0];
        }
      }
    }
    if (!o.webkit) {
      m = ua.match(/Opera[\s\/]([^\s]*)/);
      if (m && m[1]) {
        o.opera = ib(m[1]);
        m = ua.match(/Version\/([^\s]*)/);
        if (m && m[1]) {
          o.opera = ib(m[1]);
        }
        m = ua.match(/Opera Mini[^;]*/);
        if (m) {
          o.kR = m[0];
        }
      } else {
        m = ua.match(/MSIE\s([^;]*)/);
        if (m && m[1]) {
          o.sa = ib(m[1]);
        } else {
          m = ua.match(/Gecko\/([^\s]*)/);
          if (m) {
            o.pI = 1;
            m = ua.match(/rv:([^\s\)]*)/);
            if (m && m[1]) {
              o.pI = ib(m[1]);
            }
          }
        }
      }
    }
  }
  return o;
};
QMX.fZ.ua = QMX.fZ.vY();
(function () {
  QMX.namespace("sG", "widget", "example");
  if ("undefined" !== typeof QMX_config) {
    var l = QMX_config.wq,
      ls = QMX.fZ.qb,
      unique = true,
      i;
    if (l) {
      for (i = 0; i < ls.length; i++) {
        if (ls[i] == l) {
          unique = false;
          break;
        }
      }
      if (unique) {
        ls.push(l);
      }
    }
  }
})();
QMX.lang = QMX.lang || {};
(function () {
  var L = QMX.lang,
    jG = Object.prototype,
    sp = '[object Array]',
    wl = '[object Function]',
    uQ = '[object Object]',
    uR = [],
    un = {
      '&': '&amp;',
      '<': '&lt;',
      '>': '&gt;',
      '"': '&quot;',
      "'": '&#x27;',
      '/': '&#x2F;',
      '`': '&#x60;'
    },
    te = ["toString", "valueOf"],
    sL = {
      isArray: function (o) {
        return jG.toString.apply(o) === sp;
      },
      tK: function (o) {
        return typeof o === 'boolean';
      },
      isFunction: function (o) {
        return (typeof o === 'function') || jG.toString.apply(o) === wl;
      },
      wj: function (o) {
        return o === null;
      },
      ri: function (o) {
        return typeof o === 'number' && isFinite(o);
      },
      kJ: function (o) {
        return (o && (typeof o === 'object' || L.isFunction(o))) || false;
      },
      re: function (o) {
        return typeof o === 'string';
      },
      pW: function (o) {
        return typeof o === 'undefined';
      },
      sB: (QMX.fZ.ua.sa) ? function (r, s) {
        var i, mP, f;
        for (i = 0; i < te.length; i = i + 1) {
          mP = te[i];
          f = s[mP];
          if (L.isFunction(f) && f != jG[mP]) {
            r[mP] = f;
          }
        }
      } : function () {},
      xV: function (html) {
        return html.replace(/[&<>"'\/`]/g, function (match) {
          return un[match];
        });
      },
      extend: function (ig, lp, iR) {
        if (!lp || !ig) {
          throw new Error("extend failed, please check that " + "all dependencies are included.");
        }
        var F = function () {},
          i;
        F.prototype = lp.prototype;
        ig.prototype = new F();
        ig.prototype.constructor = ig;
        ig.ei = lp.prototype;
        if (lp.prototype.constructor == jG.constructor) {
          lp.prototype.constructor = lp;
        }
        if (iR) {
          for (i in iR) {
            if (L.hasOwnProperty(iR, i)) {
              ig.prototype[i] = iR[i];
            }
          }
          L.sB(ig.prototype, iR);
        }
      },
      oO: function (r, s) {
        if (!s || !r) {
          throw new Error("Absorb failed, iP dependencies.");
        }
        var a = arguments,
          i, p, pr = a[2];
        if (pr && pr !== true) {
          for (i = 2; i < a.length; i = i + 1) {
            r[a[i]] = s[a[i]];
          }
        } else {
          for (p in s) {
            if (pr || !(p in r)) {
              r[p] = s[p];
            }
          }
          L.sB(r, s);
        }
        return r;
      },
      sC: function (r, s) {
        if (!s || !r) {
          throw new Error("Augment failed, iP dependencies.");
        }
        var a = [r.prototype, s.prototype],
          i;
        for (i = 2; i < arguments.length; i = i + 1) {
          a.push(arguments[i]);
        }
        L.oO.apply(this, a);
        return r;
      },
      dump: function (o, d) {
        var i, ek, s = [],
          sH = "{...}",
          wf = "f(){...}",
          qY = ', ',
          ARROW = ' => ';
        if (!L.kJ(o)) {
          return o + "";
        } else if (o instanceof Date || ("nodeType" in o && "tagName" in o)) {
          return o;
        } else if (L.isFunction(o)) {
          return wf;
        }
        d = (L.ri(d)) ? d : 3;
        if (L.isArray(o)) {
          s.push("[");
          for (i = 0, ek = o.length; i < ek; i = i + 1) {
            if (L.kJ(o[i])) {
              s.push((d > 0) ? L.dump(o[i], d - 1) : sH);
            } else {
              s.push(o[i]);
            }
            s.push(qY);
          }
          if (s.length > 1) {
            s.pop();
          }
          s.push("]");
        } else {
          s.push("{");
          for (i in o) {
            if (L.hasOwnProperty(o, i)) {
              s.push(i + ARROW);
              if (L.kJ(o[i])) {
                s.push((d > 0) ? L.dump(o[i], d - 1) : sH);
              } else {
                s.push(o[i]);
              }
              s.push(qY);
            }
          }
          if (s.length > 1) {
            s.pop();
          }
          s.push("}");
        }
        return s.join("");
      },
      vm: function (s, o, f, wk) {
        var i, j, k, key, v, meta, jT = [],
          ml, qf = s.length,
          vH = 'dump',
          SPACE = ' ',
          vO = '{',
          tX = '}',
          dump, oH;
        for (;;) {
          i = s.lastIndexOf(vO, qf);
          if (i < 0) {
            break;
          }
          j = s.indexOf(tX, i);
          if (i + 1 > j) {
            break;
          }
          ml = s.substring(i + 1, j);
          key = ml;
          meta = null;
          k = key.indexOf(SPACE);
          if (k > -1) {
            meta = key.substring(k + 1);
            key = key.substring(0, k);
          }
          v = o[key];
          if (f) {
            v = f(key, v, meta);
          }
          if (L.kJ(v)) {
            if (L.isArray(v)) {
              v = L.dump(v, parseInt(meta, 10));
            } else {
              meta = meta || "";
              dump = meta.indexOf(vH);
              if (dump > -1) {
                meta = meta.substring(4);
              }
              oH = v.toString();
              if (oH === uQ || dump > -1) {
                v = L.dump(v, parseInt(meta, 10));
              } else {
                v = oH;
              }
            }
          } else if (!L.re(v) && !L.ri(v)) {
            v = "~-" + jT.length + "-~";
            jT[jT.length] = ml;
          }
          s = s.substring(0, i) + v + s.substring(j + 1);
          if (wk === false) {
            qf = i - 1;
          }
        }
        for (i = jT.length - 1; i >= 0; i = i - 1) {
          s = s.replace(new RegExp("~-" + i + "-~"), "{" + jT[i] + "}", "g");
        }
        return s;
      },
      trim: function (s) {
        try {
          return s.replace(/^\s+|\s+$/g, "");
        } catch (e) {
          return s;
        }
      },
      merge: function () {
        var o = {},
          a = arguments,
          l = a.length,
          i;
        for (i = 0; i < l; i = i + 1) {
          L.oO(o, a[i], true);
        }
        return o;
      },
      vD: function (when, o, fn, data, pQ) {
        when = when || 0;
        o = o || {};
        var m = fn,
          d = data,
          f, r;
        if (L.re(fn)) {
          m = o[fn];
        }
        if (!m) {
          throw new TypeError("method undefined");
        }
        if (!L.pW(data) && !L.isArray(d)) {
          d = [data];
        }
        f = function () {
          m.apply(o, d || uR);
        };
        r = (pQ) ? setInterval(f, when) : setTimeout(f, when);
        return {
          interval: pQ,
          cancel: function () {
            if (this.interval) {
              clearInterval(r);
            } else {
              clearTimeout(r);
            }
          }
        };
      },
      wg: function (o) {
        return (L.kJ(o) || L.re(o) || L.ri(o) || L.tK(o));
      }
    };
  L.hasOwnProperty = (jG.hasOwnProperty) ? function (o, prop) {
    return o && o.hasOwnProperty && o.hasOwnProperty(prop);
  } : function (o, prop) {
    return !L.pW(o[prop]) && o.constructor.prototype[prop] !== o[prop];
  };
  sL.oO(L, sL, true);
  QMX.sG.Lang = L;
  L.tU = L.sC;
  QMX.tU = L.sC;
  QMX.extend = L.extend;
})();
QMX.wr("yahoo", QMX, {
  version: "2.9.0",
  ro: "2800"
});
if (typeof Aostar == "undefined" || !Aostar) var Aostar = {};
if (typeof Aostar.dF == "undefined" || !Aostar.dF) Aostar.dF = {};
Aostar.dF.fW = new function () {
  this.vy = function (i) {
    var h = i.toString(16);
    if ((h.length % 2) == 1) h = '0' + h;
    return h;
  };
  this.sP = function (iO) {
    var h = iO.toString(16);
    if (h.substr(0, 1) != '-') {
      if (h.length % 2 == 1) {
        h = '0' + h;
      } else {
        if (!h.match(/^[0-7]/)) {
          h = '00' + h;
        }
      }
    } else {
      var wN = h.substr(1);
      var mE = wN.length;
      if (mE % 2 == 1) {
        mE += 1;
      } else {
        if (!h.match(/^[0-7]/)) {
          mE += 2;
        }
      }
      var rn = '';
      for (var i = 0; i < mE; i++) {
        rn += 'f';
      }
      var uo = new O(rn, 16);
      var uN = uo.xor(iO).add(O.ONE);
      h = uN.toString(16).replace(/^-/, '');
    }
    return h;
  };
  this.yB = function (oz, rS) {
    var tx = xk(oz);
    var mw = tx.replace(/(.{64})/g, "$1\r\n");
    mw = mw.replace(/\r\n$/, '');
    return "-----BEGIN " + rS + "-----\r\n" + mw + "\r\n-----END " + rS + "-----\r\n";
  };
  this.hO = function (param) {
    var ef = Aostar.dF;
    var keys = Object.keys(param);
    if (keys.length != 1) throw "key of param shall be only one.";
    var key = keys[0];
    if (":bool:int:bitstr:octstr:null:gg:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:ny:set:eP:".indexOf(":" + key + ":") == -1) throw "undefined key: " + key;
    if (key == "bool") return new ef.pg(param[key]);
    if (key == "int") return new ef.gu(param[key]);
    if (key == "bitstr") return new ef.nB(param[key]);
    if (key == "octstr") return new ef.jH(param[key]);
    if (key == "null") return new ef.oG(param[key]);
    if (key == "gg") return new ef.jW(param[key]);
    if (key == "enum") return new ef.nC(param[key]);
    if (key == "utf8str") return new ef.oa(param[key]);
    if (key == "numstr") return new ef.oB(param[key]);
    if (key == "prnstr") return new ef.ox(param[key]);
    if (key == "telstr") return new ef.ok(param[key]);
    if (key == "ia5str") return new ef.nF(param[key]);
    if (key == "utctime") return new ef.oK(param[key]);
    if (key == "gentime") return new ef.nM(param[key]);
    if (key == "ny") {
      var jZ = param[key];
      var a = [];
      for (var i = 0; i < jZ.length; i++) {
        var hJ = ef.fW.hO(jZ[i]);
        a.push(hJ);
      }
      return new ef.iU({
        'array': a
      });
    }
    if (key == "set") {
      var jZ = param[key];
      var a = [];
      for (var i = 0; i < jZ.length; i++) {
        var hJ = ef.fW.hO(jZ[i]);
        a.push(hJ);
      }
      return new ef.nL({
        'array': a
      });
    }
    if (key == "eP") {
      var gs = param[key];
      if (Object.prototype.toString.call(gs) === '[object Array]' && gs.length == 3) {
        var eh = ef.fW.hO(gs[2]);
        return new ef.mF({
          eP: gs[0],
          lB: gs[1],
          eh: eh
        });
      } else {
        var mC = {};
        if (gs.lB !== undefined) mC.lB = gs.lB;
        if (gs.eP !== undefined) mC.eP = gs.eP;
        if (gs.eh === undefined) throw "eh shall be specified for 'eP'.";
        mC.eh = ef.fW.hO(gs.eh);
        return new ef.mF(mC);
      }
    }
  };
  this.wx = function (param) {
    var hJ = this.hO(param);
    return hJ.hn();
  };
};
Aostar.dF.fW.nc = function (cf) {
  var s = "";
  var sN = parseInt(cf.substr(0, 2), 16);
  var ik = Math.floor(sN / 40);
  var uZ = sN % 40;
  var s = ik + "." + uZ;
  var nf = "";
  for (var i = 2; i < cf.length; i += 2) {
    var value = parseInt(cf.substr(i, 2), 16);
    var mq = ("00000000" + value.toString(2)).slice(-8);
    nf = nf + mq.substr(1, 7);
    if (mq.substr(0, 1) == "0") {
      var hv = new O(nf, 2);
      s = s + "." + hv.toString(10);
      nf = "";
    }
  };
  return s;
};
Aostar.dF.fW.yM = function (jq) {
  var kD = function (i) {
    var h = i.toString(16);
    if (h.length == 1) h = '0' + h;
    return h;
  };
  var ov = function (np) {
    var h = '';
    var hv = new O(np, 10);
    var b = hv.toString(2);
    var ic = 7 - b.length % 7;
    if (ic == 7) ic = 0;
    var kN = '';
    for (var i = 0; i < ic; i++) kN += '0';
    b = kN + b;
    for (var i = 0; i < b.length - 1; i += 7) {
      var iy = b.substr(i, 7);
      if (i != b.length - 7) iy = '1' + iy;
      h += kD(parseInt(iy, 2));
    }
    return h;
  };
  if (!jq.match(/^[0-9.]+$/)) {
    throw "malformed gg string: " + jq;
  }
  var h = '';
  var a = jq.split('.');
  var ik = parseInt(a[0]) * 40 + parseInt(a[1]);
  h += kD(ik);
  a.splice(0, 2);
  for (var i = 0; i < a.length; i++) {
    h += ov(a[i]);
  }
  return h;
};
Aostar.dF.gC = function () {
  var fo = true;
  var fE = null;
  var fz = '00';
  var mD = '00';
  var eR = '';
  this.uw = function () {
    if (typeof this.eR == "undefined" || this.eR == null) {
      throw "this.eR is null fq undefined.";
    }
    if (this.eR.length % 2 == 1) {
      throw "value cf must be even length: n=" + eR.length + ",v=" + this.eR;
    }
    var n = this.eR.length / 2;
    var jr = n.toString(16);
    if (jr.length % 2 == 1) {
      jr = "0" + jr;
    }
    if (n < 128) {
      return jr;
    } else {
      var rU = jr.length / 2;
      if (rU > 15) {
        throw "ASN.1 length too long to represent by 8x: n = " + n.toString(16);
      }
      var head = 128 + rU;
      return head.toString(16) + jr;
    }
  };
  this.hn = function () {
    if (this.fE == null || this.fo) {
      this.eR = this.gh();
      this.mD = this.uw();
      this.fE = this.fz + this.mD + this.eR;
      this.fo = false;
    }
    return this.fE;
  };
  this.yD = function () {
    this.hn();
    return this.eR;
  };
  this.gh = function () {
    return '';
  };
};
Aostar.dF.gM = function (dk) {
  Aostar.dF.gM.ei.constructor.call(this);
  var s = null;
  var eR = null;
  this.uE = function () {
    return this.s;
  };
  this.jk = function (ns) {
    this.fE = null;
    this.fo = true;
    this.s = ns;
    this.eR = lz(this.s);
  };
  this.mV = function (ia) {
    this.fE = null;
    this.fo = true;
    this.s = null;
    this.eR = ia;
  };
  this.gh = function () {
    return this.eR;
  };
  if (typeof dk != "undefined") {
    if (typeof dk == "string") {
      this.jk(dk);
    } else if (typeof dk['fb'] != "undefined") {
      this.jk(dk['fb']);
    } else if (typeof dk['cf'] != "undefined") {
      this.mV(dk['cf']);
    }
  }
};
QMX.lang.extend(Aostar.dF.gM, Aostar.dF.gC);
Aostar.dF.mf = function (dk) {
  Aostar.dF.mf.ei.constructor.call(this);
  var s = null;
  var date = null;
  this.vQ = function (d) {
    mL = d.getTime() + (d.getTimezoneOffset() * 60000);
    var ud = new Date(mL);
    return ud;
  };
  this.formatDate = function (ja, type, jL) {
    var ga = this.nh;
    var d = this.vQ(ja);
    var year = String(d.getFullYear());
    if (type == 'mL') year = year.substr(2, 2);
    var month = ga(String(d.getMonth() + 1), 2);
    var oP = ga(String(d.getDate()), 2);
    var nQ = ga(String(d.getHours()), 2);
    var min = ga(String(d.getMinutes()), 2);
    var pk = ga(String(d.getSeconds()), 2);
    var s = year + month + oP + nQ + min + pk;
    if (jL === true) {
      var oj = d.getMilliseconds();
      if (oj != 0) {
        var nZ = ga(String(oj), 3);
        nZ = nZ.replace(/[0]+$/, "");
        s = s + "." + nZ;
      }
    }
    return s + "Z";
  };
  this.nh = function (s, ek) {
    if (s.length >= ek) return s;
    return new Array(ek - s.length + 1).join('0') + s;
  };
  this.uE = function () {
    return this.s;
  };
  this.jk = function (ns) {
    this.fE = null;
    this.fo = true;
    this.s = ns;
    this.eR = lz(ns);
  };
  this.yo = function (year, month, oP, nQ, min, pk) {
    var ja = new Date(Date.UTC(year, month - 1, oP, nQ, min, pk, 0));
    this.lK(ja);
  };
  this.gh = function () {
    return this.eR;
  };
};
QMX.lang.extend(Aostar.dF.mf, Aostar.dF.gC);
Aostar.dF.oC = function (dk) {
  Aostar.dF.gM.ei.constructor.call(this);
  var ji = null;
  this.xD = function (tA) {
    this.fE = null;
    this.fo = true;
    this.ji = tA;
  };
  this.vZ = function (hh) {
    this.fE = null;
    this.fo = true;
    this.ji.push(hh);
  };
  this.ji = new Array();
  if (typeof dk != "undefined") {
    if (typeof dk['array'] != "undefined") {
      this.ji = dk['array'];
    }
  }
};
QMX.lang.extend(Aostar.dF.oC, Aostar.dF.gC);
Aostar.dF.pg = function () {
  Aostar.dF.pg.ei.constructor.call(this);
  this.fz = "01";
  this.fE = "0101ff";
};
QMX.lang.extend(Aostar.dF.pg, Aostar.dF.gC);
Aostar.dF.gu = function (dk) {
  Aostar.dF.gu.ei.constructor.call(this);
  this.fz = "02";
  this.mA = function (iO) {
    this.fE = null;
    this.fo = true;
    this.eR = Aostar.dF.fW.sP(iO);
  };
  this.lw = function (hk) {
    var hv = new O(String(hk), 10);
    this.mA(hv);
  };
  this.lk = function (ia) {
    this.eR = ia;
  };
  this.gh = function () {
    return this.eR;
  };
  if (typeof dk != "undefined") {
    if (typeof dk['kA'] != "undefined") {
      this.mA(dk['kA']);
    } else if (typeof dk['int'] != "undefined") {
      this.lw(dk['int']);
    } else if (typeof dk == "number") {
      this.lw(dk);
    } else if (typeof dk['cf'] != "undefined") {
      this.lk(dk['cf']);
    }
  }
};
QMX.lang.extend(Aostar.dF.gu, Aostar.dF.gC);
Aostar.dF.nB = function (dk) {
  if (dk !== undefined && typeof dk.eh !== "undefined") {
    var o = Aostar.dF.fW.hO(dk.eh);
    dk.cf = "00" + o.hn();
  }
  Aostar.dF.nB.ei.constructor.call(this);
  this.fz = "03";
  this.qi = function (tP) {
    this.fE = null;
    this.fo = true;
    this.eR = tP;
  };
  this.wW = function (gm, tI) {
    if (gm < 0 || 7 < gm) {
      throw "unused fO shall be from 0 to 7: u = " + gm;
    }
    var uB = "0" + gm;
    this.fE = null;
    this.fo = true;
    this.eR = uB + tI;
  };
  this.qQ = function (lf) {
    lf = lf.replace(/0+$/, '');
    var gm = 8 - lf.length % 8;
    if (gm == 8) gm = 0;
    for (var i = 0; i <= gm; i++) {
      lf += '0';
    }
    var h = '';
    for (var i = 0; i < lf.length - 1; i += 8) {
      var b = lf.substr(i, 8);
      var x = parseInt(b, 2).toString(16);
      if (x.length == 1) x = '0' + x;
      h += x;
    }
    this.fE = null;
    this.fo = true;
    this.eR = '0' + gm + h;
  };
  this.wz = function (pL) {
    var s = '';
    for (var i = 0; i < pL.length; i++) {
      if (pL[i] == true) {
        s += '1';
      } else {
        s += '0';
      }
    }
    this.qQ(s);
  };
  this.vu = function (rq) {
    var a = new Array(rq);
    for (var i = 0; i < rq; i++) {
      a[i] = false;
    }
    return a;
  };
  this.gh = function () {
    return this.eR;
  };
  if (typeof dk != "undefined") {
    if (typeof dk == "string" && dk.toLowerCase().match(/^[0-9a-f]+$/)) {
      this.qi(dk);
    } else if (typeof dk['cf'] != "undefined") {
      this.qi(dk['cf']);
    } else if (typeof dk['mq'] != "undefined") {
      this.qQ(dk['mq']);
    } else if (typeof dk['array'] != "undefined") {
      this.wz(dk['array']);
    }
  }
};
QMX.lang.extend(Aostar.dF.nB, Aostar.dF.gC);
Aostar.dF.jH = function (dk) {
  if (dk !== undefined && typeof dk.eh !== "undefined") {
    var o = Aostar.dF.fW.hO(dk.eh);
    dk.cf = o.hn();
  }
  Aostar.dF.jH.ei.constructor.call(this, dk);
  this.fz = "04";
};
QMX.lang.extend(Aostar.dF.jH, Aostar.dF.gM);
Aostar.dF.oG = function () {
  Aostar.dF.oG.ei.constructor.call(this);
  this.fz = "05";
  this.fE = "0500";
};
QMX.lang.extend(Aostar.dF.oG, Aostar.dF.gC);
Aostar.dF.jW = function (dk) {
  var kD = function (i) {
    var h = i.toString(16);
    if (h.length == 1) h = '0' + h;
    return h;
  };
  var ov = function (np) {
    var h = '';
    var hv = new O(np, 10);
    var b = hv.toString(2);
    var ic = 7 - b.length % 7;
    if (ic == 7) ic = 0;
    var kN = '';
    for (var i = 0; i < ic; i++) kN += '0';
    b = kN + b;
    for (var i = 0; i < b.length - 1; i += 7) {
      var iy = b.substr(i, 7);
      if (i != b.length - 7) iy = '1' + iy;
      h += kD(parseInt(iy, 2));
    }
    return h;
  };
  Aostar.dF.jW.ei.constructor.call(this);
  this.fz = "06";
  this.lk = function (ia) {
    this.fE = null;
    this.fo = true;
    this.s = null;
    this.eR = ia;
  };
  this.lW = function (jq) {
    if (!jq.match(/^[0-9.]+$/)) {
      throw "malformed gg string: " + jq;
    }
    var h = '';
    var a = jq.split('.');
    var ik = parseInt(a[0]) * 40 + parseInt(a[1]);
    h += kD(ik);
    a.splice(0, 2);
    for (var i = 0; i < a.length; i++) {
      h += ov(a[i]);
    }
    this.fE = null;
    this.fo = true;
    this.s = null;
    this.eR = h;
  };
  this.qg = function (hH) {
    var gg = Aostar.dF.jv.jP.wn(hH);
    if (gg !== '') {
      this.lW(gg);
    } else {
      throw "jW hH undefined: " + hH;
    }
  };
  this.gh = function () {
    return this.eR;
  };
  if (dk !== undefined) {
    if (typeof dk === "string") {
      if (dk.match(/^[0-2].[0-9.]+$/)) {
        this.lW(dk);
      } else {
        this.qg(dk);
      }
    } else if (dk.gg !== undefined) {
      this.lW(dk.gg);
    } else if (dk.cf !== undefined) {
      this.lk(dk.cf);
    } else if (dk.name !== undefined) {
      this.qg(dk.name);
    }
  }
};
QMX.lang.extend(Aostar.dF.jW, Aostar.dF.gC);
Aostar.dF.nC = function (dk) {
  Aostar.dF.nC.ei.constructor.call(this);
  this.fz = "0a";
  this.mA = function (iO) {
    this.fE = null;
    this.fo = true;
    this.eR = Aostar.dF.fW.sP(iO);
  };
  this.lw = function (hk) {
    var hv = new O(String(hk), 10);
    this.mA(hv);
  };
  this.lk = function (ia) {
    this.eR = ia;
  };
  this.gh = function () {
    return this.eR;
  };
  if (typeof dk != "undefined") {
    if (typeof dk['int'] != "undefined") {
      this.lw(dk['int']);
    } else if (typeof dk == "number") {
      this.lw(dk);
    } else if (typeof dk['cf'] != "undefined") {
      this.lk(dk['cf']);
    }
  }
};
QMX.lang.extend(Aostar.dF.nC, Aostar.dF.gC);
Aostar.dF.oa = function (dk) {
  Aostar.dF.oa.ei.constructor.call(this, dk);
  this.fz = "0c";
};
QMX.lang.extend(Aostar.dF.oa, Aostar.dF.gM);
Aostar.dF.oB = function (dk) {
  Aostar.dF.oB.ei.constructor.call(this, dk);
  this.fz = "12";
};
QMX.lang.extend(Aostar.dF.oB, Aostar.dF.gM);
Aostar.dF.ox = function (dk) {
  Aostar.dF.ox.ei.constructor.call(this, dk);
  this.fz = "13";
};
QMX.lang.extend(Aostar.dF.ox, Aostar.dF.gM);
Aostar.dF.ok = function (dk) {
  Aostar.dF.ok.ei.constructor.call(this, dk);
  this.fz = "14";
};
QMX.lang.extend(Aostar.dF.ok, Aostar.dF.gM);
Aostar.dF.nF = function (dk) {
  Aostar.dF.nF.ei.constructor.call(this, dk);
  this.fz = "16";
};
QMX.lang.extend(Aostar.dF.nF, Aostar.dF.gM);
Aostar.dF.oK = function (dk) {
  Aostar.dF.oK.ei.constructor.call(this, dk);
  this.fz = "17";
  this.lK = function (ja) {
    this.fE = null;
    this.fo = true;
    this.date = ja;
    this.s = this.formatDate(this.date, 'mL');
    this.eR = lz(this.s);
  };
  this.gh = function () {
    if (typeof this.date == "undefined" && typeof this.s == "undefined") {
      this.date = new Date();
      this.s = this.formatDate(this.date, 'mL');
      this.eR = lz(this.s);
    }
    return this.eR;
  };
  if (dk !== undefined) {
    if (dk.fb !== undefined) {
      this.jk(dk.fb);
    } else if (typeof dk == "string" && dk.match(/^[0-9]{12}Z$/)) {
      this.jk(dk);
    } else if (dk.cf !== undefined) {
      this.mV(dk.cf);
    } else if (dk.date !== undefined) {
      this.lK(dk.date);
    }
  }
};
QMX.lang.extend(Aostar.dF.oK, Aostar.dF.mf);
Aostar.dF.nM = function (dk) {
  Aostar.dF.nM.ei.constructor.call(this, dk);
  this.fz = "18";
  this.jL = false;
  this.lK = function (ja) {
    this.fE = null;
    this.fo = true;
    this.date = ja;
    this.s = this.formatDate(this.date, 'gen', this.jL);
    this.eR = lz(this.s);
  };
  this.gh = function () {
    if (this.date === undefined && this.s === undefined) {
      this.date = new Date();
      this.s = this.formatDate(this.date, 'gen', this.jL);
      this.eR = lz(this.s);
    }
    return this.eR;
  };
  if (dk !== undefined) {
    if (dk.fb !== undefined) {
      this.jk(dk.fb);
    } else if (typeof dk == "string" && dk.match(/^[0-9]{14}Z$/)) {
      this.jk(dk);
    } else if (dk.cf !== undefined) {
      this.mV(dk.cf);
    } else if (dk.date !== undefined) {
      this.lK(dk.date);
    }
    if (dk.oj === true) {
      this.jL = true;
    }
  }
};
QMX.lang.extend(Aostar.dF.nM, Aostar.dF.mf);
Aostar.dF.iU = function (dk) {
  Aostar.dF.iU.ei.constructor.call(this, dk);
  this.fz = "30";
  this.gh = function () {
    var h = '';
    for (var i = 0; i < this.ji.length; i++) {
      var hJ = this.ji[i];
      h += hJ.hn();
    }
    this.eR = h;
    return this.eR;
  };
};
QMX.lang.extend(Aostar.dF.iU, Aostar.dF.oC);
Aostar.dF.nL = function (dk) {
  Aostar.dF.nL.ei.constructor.call(this, dk);
  this.fz = "31";
  this.qB = true;
  this.gh = function () {
    var a = new Array();
    for (var i = 0; i < this.ji.length; i++) {
      var hJ = this.ji[i];
      a.push(hJ.hn());
    }
    if (this.qB == true) a.sort();
    this.eR = a.join('');
    return this.eR;
  };
  if (typeof dk != "undefined") {
    if (typeof dk.sX != "undefined" && dk.sX == false) this.qB = false;
  }
};
QMX.lang.extend(Aostar.dF.nL, Aostar.dF.oC);
Aostar.dF.mF = function (dk) {
  Aostar.dF.mF.ei.constructor.call(this);
  this.fz = "a0";
  this.eR = '';
  this.mG = true;
  this.hh = null;
  this.wa = function (wD, qE, hh) {
    this.fz = qE;
    this.mG = wD;
    this.hh = hh;
    if (this.mG) {
      this.eR = this.hh.hn();
      this.fE = null;
      this.fo = true;
    } else {
      this.eR = null;
      this.fE = hh.hn();
      this.fE = this.fE.replace(/^../, qE);
      this.fo = false;
    }
  };
  this.gh = function () {
    return this.eR;
  };
  if (typeof dk != "undefined") {
    if (typeof dk['eP'] != "undefined") {
      this.fz = dk['eP'];
    }
    if (typeof dk['lB'] != "undefined") {
      this.mG = dk['lB'];
    }
    if (typeof dk['eh'] != "undefined") {
      this.hh = dk['eh'];
      this.wa(this.mG, this.fz, this.hh);
    }
  }
};
QMX.lang.extend(Aostar.dF.mF, Aostar.dF.gC);
var cT = new function () {};
cT.pV = function (s, pos) {
  if (s.substring(pos + 2, pos + 3) != '8') return 1;
  var i = parseInt(s.substring(pos + 3, pos + 4));
  if (i == 0) return -1;
  if (0 < i && i < 10) return i + 1;
  return -2;
};
cT.ph = function (s, pos) {
  var ek = cT.pV(s, pos);
  if (ek < 1) return '';
  return s.substring(pos + 2, pos + 2 + ek * 2);
};
cT.mY = function (s, pos) {
  var mT = cT.ph(s, pos);
  if (mT == '') return -1;
  var hv;
  if (parseInt(mT.substring(0, 1)) < 8) {
    hv = new O(mT, 16);
  } else {
    hv = new O(mT.substring(2), 16);
  }
  return hv.hk();
};
cT.pa = function (s, pos) {
  var pS = cT.pV(s, pos);
  if (pS < 0) return pS;
  return pos + (pS + 1) * 2;
};
cT.fg = function (s, pos) {
  var mH = cT.pa(s, pos);
  var ek = cT.mY(s, pos);
  return s.substring(mH, mH + ek * 2);
};
cT.uj = function (s, pos) {
  var fz = s.substr(pos, 2);
  var mD = cT.ph(s, pos);
  var eR = cT.fg(s, pos);
  return fz + mD + eR;
};
cT.uF = function (s, pos) {
  var mH = cT.pa(s, pos);
  var ek = cT.mY(s, pos);
  return mH + ek * 2;
};
cT.iT = function (h, pos) {
  var a = new Array();
  var lC = cT.pa(h, pos);
  if (h.substr(pos, 2) == "03") {
    a.push(lC + 2);
  } else {
    a.push(lC);
  }
  var ek = cT.mY(h, pos);
  var p = lC;
  var k = 0;
  while (1) {
    var mo = cT.uF(h, p);
    if (mo == null || (mo - lC >= (ek * 2))) break;
    if (k >= 200) break;
    a.push(mo);
    p = mo;
    k++;
  }
  return a;
};
cT.xq = function (h, cq, nth) {
  var a = cT.iT(h, cq);
  return a[nth];
};
cT.nk = function (h, iM, gp) {
  if (gp.length == 0) {
    return iM;
  }
  var wQ = gp.shift();
  var a = cT.iT(h, iM);
  return cT.nk(h, a[wQ], gp);
};
cT.xN = function (h, iM, gp) {
  var cq = cT.nk(h, iM, gp);
  return cT.uj(h, cq);
};
cT.yq = function (h, iM, gp) {
  var cq = cT.nk(h, iM, gp);
  return cT.fg(h, cq);
};
cT.ya = function (h, iM, gp, ow) {
  var cq = cT.nk(h, iM, gp);
  if (cq === undefined) {
    throw "can't find gp object";
  }
  if (ow !== undefined) {
    if (h.substr(cq, 2) != ow) {
      throw "checking eP doesn't match: " + h.substr(cq, 2) + "!=" + ow;
    }
  }
  return cT.fg(h, cq);
};
cT.xK = function (cf) {
  var nh = function (s, ek) {
    if (s.length >= ek) return s;
    return new Array(ek - s.length + 1).join('0') + s;
  };
  var a = [];
  var wE = cf.substr(0, 2);
  var ik = parseInt(wE, 16);
  a[0] = new String(Math.floor(ik / 40));
  a[1] = new String(ik % 40);
  var rD = cf.substr(2);
  var b = [];
  for (var i = 0; i < rD.length / 2; i++) {
    b.push(parseInt(rD.substr(i * 2, 2), 16));
  }
  var c = [];
  var lo = "";
  for (var i = 0; i < b.length; i++) {
    if (b[i] & 0x80) {
      lo = lo + nh((b[i] & 0x7f).toString(2), 7);
    } else {
      lo = lo + nh((b[i] & 0x7f).toString(2), 7);
      c.push(new String(parseInt(lo, 2)));
      lo = "";
    }
  }
  var s = a.join(".");
  if (c.length > 0) s = s + "." + c.join(".");
  return s;
};
cT.dump = function (jl, ev, cq, indent) {
  var cf = jl;
  if (jl instanceof Aostar.dF.gC) cf = jl.hn();
  var lu = function (cf, fP) {
    if (cf.length <= fP * 2) {
      return cf;
    } else {
      var s = cf.substr(0, fP) + "..(total " + cf.length / 2 + "fe).." + cf.substr(cf.length - fP, fP);
      return s;
    };
  };
  if (ev === undefined) ev = {
    "pb": 32
  };
  if (cq === undefined) cq = 0;
  if (indent === undefined) indent = "";
  var ly = ev.pb;
  if (cf.substr(cq, 2) == "01") {
    var v = cT.fg(cf, cq);
    if (v == "00") {
      return indent + "BOOLEAN FALSE\n";
    } else {
      return indent + "BOOLEAN TRUE\n";
    }
  }
  if (cf.substr(cq, 2) == "02") {
    var v = cT.fg(cf, cq);
    return indent + "INTEGER " + lu(v, ly) + "\n";
  }
  if (cf.substr(cq, 2) == "03") {
    var v = cT.fg(cf, cq);
    return indent + "BITSTRING " + lu(v, ly) + "\n";
  }
  if (cf.substr(cq, 2) == "04") {
    var v = cT.fg(cf, cq);
    if (cT.sS(v)) {
      var s = indent + "OCTETSTRING, encapsulates\n";
      s = s + cT.dump(v, ev, 0, indent + "  ");
      return s;
    } else {
      return indent + "OCTETSTRING " + lu(v, ly) + "\n";
    }
  }
  if (cf.substr(cq, 2) == "05") {
    return indent + "NULL\n";
  }
  if (cf.substr(cq, 2) == "06") {
    var eR = cT.fg(cf, cq);
    var jz = Aostar.dF.fW.nc(eR);
    var hH = Aostar.dF.jv.jP.nn(jz);
    var jJ = jz.replace(/\./g, ' ');
    if (hH != '') {
      return indent + "ObjectIdentifier " + hH + " (" + jJ + ")\n";
    } else {
      return indent + "ObjectIdentifier (" + jJ + ")\n";
    }
  }
  if (cf.substr(cq, 2) == "0c") {
    return indent + "UTF8String '" + ff(cT.fg(cf, cq)) + "'\n";
  }
  if (cf.substr(cq, 2) == "13") {
    return indent + "PrintableString '" + ff(cT.fg(cf, cq)) + "'\n";
  }
  if (cf.substr(cq, 2) == "14") {
    return indent + "TeletexString '" + ff(cT.fg(cf, cq)) + "'\n";
  }
  if (cf.substr(cq, 2) == "16") {
    return indent + "IA5String '" + ff(cT.fg(cf, cq)) + "'\n";
  }
  if (cf.substr(cq, 2) == "17") {
    return indent + "UTCTime " + ff(cT.fg(cf, cq)) + "\n";
  }
  if (cf.substr(cq, 2) == "18") {
    return indent + "GeneralizedTime " + ff(cT.fg(cf, cq)) + "\n";
  }
  if (cf.substr(cq, 2) == "30") {
    if (cf.substr(cq, 4) == "3000") {
      return indent + "SEQUENCE {}\n";
    }
    var s = indent + "SEQUENCE\n";
    var eF = cT.iT(cf, cq);
    var lb = ev;
    if ((eF.length == 2 || eF.length == 3) && cf.substr(eF[0], 2) == "06" && cf.substr(eF[eF.length - 1], 2) == "04") {
      var lT = cT.fg(cf, eF[0]);
      var jz = Aostar.dF.fW.nc(lT);
      var hH = Aostar.dF.jv.jP.nn(jz);
      var la = JSON.parse(JSON.stringify(ev));
      la.mO = hH;
      lb = la;
    }
    for (var i = 0; i < eF.length; i++) {
      s = s + cT.dump(cf, lb, eF[i], indent + "  ");
    }
    return s;
  }
  if (cf.substr(cq, 2) == "31") {
    var s = indent + "SET\n";
    var eF = cT.iT(cf, cq);
    for (var i = 0; i < eF.length; i++) {
      s = s + cT.dump(cf, ev, eF[i], indent + "  ");
    }
    return s;
  }
  var eP = parseInt(cf.substr(cq, 2), 16);
  if ((eP & 128) != 0) {
    var ih = eP & 31;
    if ((eP & 32) != 0) {
      var s = indent + "[" + ih + "]\n";
      var eF = cT.iT(cf, cq);
      for (var i = 0; i < eF.length; i++) {
        s = s + cT.dump(cf, ev, eF[i], indent + "  ");
      }
      return s;
    } else {
      var v = cT.fg(cf, cq);
      if (v.substr(0, 8) == "68747470") {
        v = ff(v);
      }
      if (ev.mO === "subjectAltName" && ih == 2) {
        v = ff(v);
      }
      var s = indent + "[" + ih + "] " + v + "\n";
      return s;
    }
  }
  return indent + "UNKNOWN(" + cf.substr(cq, 2) + ") " + cT.fg(cf, cq) + "\n";
};
cT.kk = function (jl, ev, cq) {
  var cf = jl;
  if (jl instanceof Aostar.dF.gC) cf = jl.hn();
  var lu = function (cf, fP) {
    if (cf.length <= fP * 2) {
      return cf;
    } else {
      var s = cf.substr(0, fP) + cf.substr(cf.length - fP, fP);
      return s;
    };
  };
  if (ev === undefined) ev = {
    "pb": 32
  };
  if (cq === undefined) cq = 0;
  var ly = ev.pb;
  if (cf.substr(cq, 2) == "01") {
    var v = cT.fg(cf, cq);
    if (v == "00") {
      return false;
    } else {
      return true;
    }
  }
  if (cf.substr(cq, 2) == "02") {
    var v = cT.fg(cf, cq);
    return v;
  }
  if (cf.substr(cq, 2) == "03") {
    var v = cT.fg(cf, cq);
    return lu(v, ly);
  }
  if (cf.substr(cq, 2) == "04") {
    var v = cT.fg(cf, cq);
    if (cT.sS(v)) {
      var s = new Array();
      s.push(cT.kk(v, ev, 0));
      return s;
    } else {
      return v;
    }
  }
  if (cf.substr(cq, 2) == "05") {
    return "";
  }
  if (cf.substr(cq, 2) == "06") {
    var eR = cT.fg(cf, cq);
    var jz = Aostar.dF.fW.nc(eR);
    var hH = Aostar.dF.jv.jP.nn(jz);
    var jJ = jz.replace(/\./g, ' ');
    if (hH != '') {
      return jJ;
    } else {
      return jJ;
    }
  }
  if (cf.substr(cq, 2) == "0c") {
    return ff(cT.fg(cf, cq));
  }
  if (cf.substr(cq, 2) == "13") {
    return ff(cT.fg(cf, cq));
  }
  if (cf.substr(cq, 2) == "14") {
    return ff(cT.fg(cf, cq));
  }
  if (cf.substr(cq, 2) == "16") {
    return ff(cT.fg(cf, cq));
  }
  if (cf.substr(cq, 2) == "17") {
    return ff(cT.fg(cf, cq));
  }
  if (cf.substr(cq, 2) == "18") {
    return ff(cT.fg(cf, cq));
  }
  if (cf.substr(cq, 2) == "30") {
    var s = new Array();
    if (cf.substr(cq, 4) == "3000") {
      return s;
    }
    var eF = cT.iT(cf, cq);
    var lb = ev;
    if ((eF.length == 2 || eF.length == 3) && cf.substr(eF[0], 2) == "06" && cf.substr(eF[eF.length - 1], 2) == "04") {
      var lT = cT.fg(cf, eF[0]);
      var jz = Aostar.dF.fW.nc(lT);
      var hH = Aostar.dF.jv.jP.nn(jz);
      var la = JSON.parse(JSON.stringify(ev));
      la.mO = hH;
      lb = la;
    }
    for (var i = 0; i < eF.length; i++) {
      s.push(cT.kk(cf, lb, eF[i]));
    }
    return s;
  }
  if (cf.substr(cq, 2) == "31") {
    var s = new Array();;
    var eF = cT.iT(cf, cq);
    for (var i = 0; i < eF.length; i++) {
      s.push(cT.kk(cf, ev, eF[i]));
    }
    return s;
  }
  var eP = parseInt(cf.substr(cq, 2), 16);
  var indent = "";
  if ((eP & 128) != 0) {
    var ih = eP & 31;
    if ((eP & 32) != 0) {
      var s = indent + "[" + ih + "]\n";
      var eF = cT.iT(cf, cq);
      for (var i = 0; i < eF.length; i++) {
        s = s + cT.dump(cf, ev, eF[i], indent + "  ");
      }
      return s;
    } else {
      var v = cT.fg(cf, cq);
      if (v.substr(0, 8) == "68747470") {
        v = ff(v);
      }
      if (ev.mO === "subjectAltName" && ih == 2) {
        v = ff(v);
      }
      var s = indent + "[" + ih + "] " + v + "\n";
      return s;
    }
  }
  return indent + "UNKNOWN(" + cf.substr(cq, 2) + ") " + cT.fg(cf, cq) + "\n";
};
cT.sS = function (cf) {
  if (cf.length % 2 == 1) return false;
  var uJ = cT.mY(cf, 0);
  var tV = cf.substr(0, 2);
  var wG = cT.ph(cf, 0);
  var vR = cf.length - tV.length - wG.length;
  if (vR == uJ * 2) return true;
  return false;
};
var ko = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var nP = "=";

function bZ(h) {
  var i;
  var c;
  var dY = "";
  for (i = 0; i + 3 <= h.length; i += 3) {
    c = parseInt(h.substring(i, i + 3), 16);
    dY += ko.charAt(c >> 6) + ko.charAt(c & 63);
  }
  if (i + 1 == h.length) {
    c = parseInt(h.substring(i, i + 1), 16);
    dY += ko.charAt(c << 2);
  } else if (i + 2 == h.length) {
    c = parseInt(h.substring(i, i + 2), 16);
    dY += ko.charAt(c >> 2) + ko.charAt((c & 3) << 4);
  }
  if (nP)
    while ((dY.length & 3) > 0) dY += nP;
  return dY;
};

function dc(s) {
  var dY = "";
  var i;
  var k = 0;
  var iL;
  var v;
  for (i = 0; i < s.length; ++i) {
    if (s.charAt(i) == nP) break;
    v = ko.indexOf(s.charAt(i));
    if (v < 0) continue;
    if (k == 0) {
      dY += an(v >> 2);
      iL = v & 3;
      k = 1;
    } else if (k == 1) {
      dY += an((iL << 2) | (v >> 4));
      iL = v & 0xf;
      k = 2;
    } else if (k == 2) {
      dY += an(iL);
      dY += an(v >> 2);
      iL = v & 3;
      k = 3;
    } else {
      dY += an((iL << 2) | (v >> 4));
      dY += an(v & 0xf);
      k = 0;
    }
  }
  if (k == 1) dY += an(iL << 2);
  return dY;
};

function dm(s) {
  var h = dc(s);
  var i;
  var a = new Array();
  for (i = 0; 2 * i < h.length; ++i) {
    a[i] = parseInt(h.substring(2 * i, 2 * i + 2), 16);
  }
  return a;
};
AostarJS.jh.kr || (function (undefined) {
  var C = AostarJS;
  var eD = C.jh;
  var Base = eD.Base;
  var et = eD.et;
  var iX = eD.iX;
  var il = C.dX;
  var eN = il.eN;
  var oQ = il.oQ;
  var kP = C.gV;
  var rg = kP.rg;
  var kr = eD.kr = iX.extend({
    cw: Base.extend(),
    pd: function (key, cw) {
      return this.create(this.rd, key, cw);
    },
    oY: function (key, cw) {
      return this.create(this.rH, key, cw);
    },
    ej: function (tg, key, cw) {
      this.cw = this.cw.extend(cw);
      this.ta = tg;
      this.vT = key;
      this.reset();
    },
    reset: function () {
      iX.reset.call(this);
      this.ql();
    },
    yQ: function (nt) {
      this.mn(nt);
      return this.kq();
    },
    hU: function (nt) {
      if (nt) {
        this.mn(nt);
      }
      var wT = this.lM();
      return wT;
    },
    hB: 128 / 32,
    kT: 128 / 32,
    rd: 1,
    rH: 2,
    pO: (function () {
      function ax(key) {
        if (typeof key == 'string') {
          return pK;
        } else {
          return lA;
        }
      };
      return function (dr) {
        return {
          lF: function (message, key, cw) {
            return ax(key).lF(dr, message, key, cw);
          },
          lL: function (fm, key, cw) {
            return ax(key).lL(dr, fm, key, cw);
          }
        };
      };
    }())
  });
  var tQ = eD.tQ = kr.extend({
    lM: function () {
      var kM = this.kq(!!'flush');
      return kM;
    },
    eB: 1
  });
  var sA = C.mode = {};
  var pR = eD.pR = Base.extend({
    pd: function (dr, eA) {
      return this.wP.create(dr, eA);
    },
    oY: function (dr, eA) {
      return this.rs.create(dr, eA);
    },
    ej: function (dr, eA) {
      this.qx = dr;
      this.sj = eA;
    }
  });
  var CBC = sA.CBC = (function () {
    var CBC = pR.extend();
    CBC.wP = CBC.extend({
      pG: function (cA, offset) {
        var dr = this.qx;
        var eB = dr.eB;
        al.call(this, cA, offset, eB);
        dr.xT(cA, offset);
        this.st = cA.slice(offset, offset + eB);
      }
    });
    CBC.rs = CBC.extend({
      pG: function (cA, offset) {
        var dr = this.qx;
        var eB = dr.eB;
        var sr = cA.slice(offset, offset + eB);
        dr.wo(cA, offset);
        al.call(this, cA, offset, eB);
        this.st = sr;
      }
    });

    function al(cA, offset, eB) {
      var eA = this.sj;
      if (eA) {
        var block = eA;
        this.sj = undefined;
      } else {
        var block = this.st;
      }
      for (var i = 0; i < eB; i++) {
        cA[offset + i] ^= block[i];
      }
    };
    return CBC;
  }());
  var tW = C.ga = {};
  var qU = tW.qU = {
    ga: function (data, eB) {
      var mk = eB * 4;
      var jp = mk - data.fI % mk;
      var vK = (jp << 24) | (jp << 16) | (jp << 8) | jp;
      var rY = [];
      for (var i = 0; i < jp; i += 4) {
        rY.push(vK);
      }
      var padding = et.create(rY, jp);
      data.concat(padding);
    },
    ub: function (data) {
      var jp = data.cA[(data.fI - 1) >>> 2] & 0xff;
      data.fI -= jp;
    }
  };
  var tO = eD.tO = kr.extend({
    cw: kr.cw.extend({
      mode: CBC,
      padding: qU
    }),
    reset: function () {
      kr.reset.call(this);
      var cw = this.cw;
      var eA = cw.eA;
      var mode = cw.mode;
      if (this.ta == this.rd) {
        var rz = mode.pd;
      } else {
        var rz = mode.oY;
        this.pH = 1;
      }
      this.sI = rz.call(mode, this, eA && eA.cA);
    },
    pM: function (cA, offset) {
      this.sI.pG(cA, offset);
    },
    lM: function () {
      var padding = this.cw.padding;
      if (this.ta == this.rd) {
        padding.ga(this.hG, this.eB);
        var kM = this.kq(!!'flush');
      } else {
        var kM = this.kq(!!'flush');
        padding.ub(kM);
      }
      return kM;
    },
    eB: 128 / 32
  });
  var nl = eD.nl = Base.extend({
    ej: function (nr) {
      this.ps(nr);
    },
    toString: function (nK) {
      return (nK || this.nK).stringify(this);
    }
  });
  var sV = C.format = {};
  var tY = sV.uG = {
    stringify: function (nr) {
      var fm = nr.fm;
      var gZ = nr.gZ;
      if (gZ) {
        var ep = et.create([0x53616c74, 0x65645f5f]).concat(gZ).concat(fm);
      } else {
        var ep = fm;
      }
      return ep.toString(oQ);
    },
    parse: function (uy) {
      var fm = oQ.parse(uy);
      var mJ = fm.cA;
      if (mJ[0] == 0x53616c74 && mJ[1] == 0x65645f5f) {
        var gZ = et.create(mJ.slice(2, 4));
        mJ.splice(0, 4);
        fm.fI -= 16;
      }
      return nl.create({
        fm: fm,
        gZ: gZ
      });
    }
  };
  var lA = eD.lA = Base.extend({
    cw: Base.extend({
      format: tY
    }),
    lF: function (dr, message, key, cw) {
      cw = this.cw.extend(cw);
      var rh = dr.pd(key, cw);
      var fm = rh.hU(message);
      var pn = rh.cw;
      return nl.create({
        fm: fm,
        key: key,
        eA: pn.eA,
        vI: dr,
        mode: pn.mode,
        padding: pn.padding,
        eB: dr.eB,
        nK: cw.format
      });
    },
    lL: function (dr, fm, key, cw) {
      cw = this.cw.extend(cw);
      fm = this.su(fm, cw.format);
      var plaintext = dr.oY(key, cw).hU(fm.fm || fm);
      return plaintext;
    },
    su: function (fm, format) {
      if (typeof fm == 'string') {
        return format.parse(fm, this);
      } else {
        return fm;
      }
    }
  });
  var sy = C.oI = {};
  var uD = sy.uG = {
    pP: function (kI, hB, kT, gZ) {
      if (!gZ) {
        gZ = et.random(64 / 8);
      }
      var key = rg.create({
        hB: hB + kT
      }).wV(kI, gZ);
      var eA = et.create(key.cA.slice(hB), kT * 4);
      key.fI = hB * 4;
      return nl.create({
        key: key,
        eA: eA,
        gZ: gZ
      });
    }
  };
  var pK = eD.pK = lA.extend({
    cw: lA.cw.extend({
      oI: uD
    }),
    lF: function (dr, message, kI, cw) {
      cw = this.cw.extend(cw);
      var iA = cw.oI.pP(kI, dr.hB, dr.kT);
      cw.eA = iA.eA;
      var fm = lA.lF.call(this, dr, message, iA.key, cw);
      fm.ps(iA);
      return fm;
    },
    lL: function (dr, fm, kI, cw) {
      cw = this.cw.extend(cw);
      fm = this.su(fm, cw.format);
      var iA = cw.oI.pP(kI, dr.hB, dr.kT, fm.gZ);
      cw.eA = iA.eA;
      var plaintext = lA.lL.call(this, dr, fm, iA.key, cw);
      return plaintext;
    }
  });
}());

function J(q, x) {
  this.x = x;
  this.q = q;
};

function du(other) {
  if (other == this) return true;
  return (this.q.el(other.q) && this.x.el(other.x));
};

function dJ() {
  return this.x;
};

function cg() {
  return new J(this.q, this.x.gR().ez(this.q));
};

function dN(b) {
  return new J(this.q, this.x.add(b.dG()).ez(this.q));
};

function bW(b) {
  return new J(this.q, this.x.eZ(b.dG()).ez(this.q));
};

function dM(b) {
  return new J(this.q, this.x.multiply(b.dG()).ez(this.q));
};

function dR() {
  return new J(this.q, this.x.square().ez(this.q));
};

function di(b) {
  return new J(this.q, this.x.multiply(b.dG().ij(this.q)).ez(this.q));
};
J.prototype.el = du;
J.prototype.dG = dJ;
J.prototype.gR = cg;
J.prototype.add = dN;
J.prototype.eZ = bW;
J.prototype.multiply = dM;
J.prototype.square = dR;
J.prototype.divide = di;

function K(cj, x, y, z) {
  this.cj = cj;
  this.x = x;
  this.y = y;
  if (z == null) {
    this.z = O.ONE;
  } else {
    this.z = z;
  }
  this.jO = null;
};

function cn() {
  if (this.jO == null) {
    this.jO = this.z.ij(this.cj.q);
  }
  return this.cj.dU(this.x.dG().multiply(this.jO).ez(this.cj.q));
};

function cO() {
  if (this.jO == null) {
    this.jO = this.z.ij(this.cj.q);
  }
  return this.cj.dU(this.y.dG().multiply(this.jO).ez(this.cj.q));
};

function dq(other) {
  if (other == this) return true;
  if (this.gG()) return other.gG();
  if (other.gG()) return this.gG();
  var u, v;
  u = other.y.dG().multiply(this.z).eZ(this.y.dG().multiply(other.z)).ez(this.cj.q);
  if (!u.el(O.ZERO)) return false;
  v = other.x.dG().multiply(this.z).eZ(this.x.dG().multiply(other.z)).ez(this.cj.q);
  return v.el(O.ZERO);
};

function dP() {
  if ((this.x == null) && (this.y == null)) return true;
  return this.z.el(O.ZERO) && !this.y.dG().el(O.ZERO);
};

function cR() {
  return new K(this.cj, this.x, this.y.gR(), this.z);
};

function dw(b) {
  if (this.gG()) return b;
  if (b.gG()) return this;
  var u = b.y.dG().multiply(this.z).eZ(this.y.dG().multiply(b.z)).ez(this.cj.q);
  var v = b.x.dG().multiply(this.z).eZ(this.x.dG().multiply(b.z)).ez(this.cj.q);
  if (O.ZERO.el(v)) {
    if (O.ZERO.el(u)) {
      return this.kK();
    }
    return this.cj.gS();
  }
  var kd = new O("3");
  var x1 = this.x.dG();
  var y1 = this.y.dG();
  var x2 = b.x.dG();
  var y2 = b.y.dG();
  var sl = v.square();
  var lJ = sl.multiply(v);
  var qt = x1.multiply(sl);
  var qy = u.square().multiply(this.z);
  var gi = qy.eZ(qt.shiftLeft(1)).multiply(b.z).eZ(lJ).multiply(v).ez(this.cj.q);
  var jD = qt.multiply(kd).multiply(u).eZ(y1.multiply(lJ)).eZ(qy.multiply(u)).multiply(b.z).add(u.multiply(lJ)).ez(this.cj.q);
  var lZ = lJ.multiply(this.z).multiply(b.z).ez(this.cj.q);
  return new K(this.cj, this.cj.dU(gi), this.cj.dU(jD), lZ);
};

function da() {
  if (this.gG()) return this;
  if (this.y.dG().es() == 0) return this.cj.gS();
  var kd = new O("3");
  var x1 = this.x.dG();
  var y1 = this.y.dG();
  var mU = y1.multiply(this.z);
  var nA = mU.multiply(y1).ez(this.cj.q);
  var a = this.cj.a.dG();
  var w = x1.square().multiply(kd);
  if (!O.ZERO.el(a)) {
    w = w.add(this.z.square().multiply(a));
  }
  w = w.ez(this.cj.q);
  var gi = w.square().eZ(x1.shiftLeft(3).multiply(nA)).shiftLeft(1).multiply(mU).ez(this.cj.q);
  var jD = w.multiply(kd).multiply(x1).eZ(nA.shiftLeft(1)).shiftLeft(2).multiply(nA).eZ(w.square().multiply(w)).ez(this.cj.q);
  var lZ = mU.square().multiply(mU).shiftLeft(3).ez(this.cj.q);
  return new K(this.cj, this.cj.dU(gi), this.cj.dU(jD), lZ);
};

function dv(k) {
  if (this.gG()) return this;
  if (k.es() == 0) return this.cj.gS();
  var e = k;
  var h = e.multiply(new O("3"));
  var pq = this.gR();
  var R = this;
  var i;
  for (i = h.eV() - 2; i > 0; --i) {
    R = R.kK();
    var kg = h.eJ(i);
    var oR = e.eJ(i);
    if (kg != oR) {
      R = R.add(kg ? this : pq);
    }
  }
  return R;
};

function cZ(j, x, k) {
  var i;
  if (j.eV() > k.eV()) i = j.eV() - 1;
  else i = k.eV() - 1;
  var R = this.cj.gS();
  var both = this.add(x);
  while (i >= 0) {
    R = R.kK();
    if (j.eJ(i)) {
      if (k.eJ(i)) {
        R = R.add(both);
      } else {
        R = R.add(this);
      }
    } else {
      if (k.eJ(i)) {
        R = R.add(x);
      }
    }--i;
  }
  return R;
};
K.prototype.fv = cn;
K.prototype.fw = cO;
K.prototype.el = dq;
K.prototype.gG = dP;
K.prototype.gR = cR;
K.prototype.add = dw;
K.prototype.kK = da;
K.prototype.multiply = dv;
K.prototype.xc = cZ;

function bw(q, a, b) {
  this.q = q;
  this.a = this.dU(a);
  this.b = this.dU(b);
  this.nJ = new K(this, null, null);
};

function dp() {
  return this.q;
};

function dg() {
  return this.a;
};

function bY() {
  return this.b;
};

function df(other) {
  if (other == this) return true;
  return (this.q.el(other.q) && this.a.el(other.a) && this.b.el(other.b));
};

function cI() {
  return this.nJ;
};

function cK(x) {
  return new J(this.q, x);
};

function cD(s) {
  switch (parseInt(s.substr(0, 2), 16)) {
    case 0:
      return this.nJ;
    case 2:
    case 3:
      return null;
    case 4:
    case 6:
    case 7:
      var ek = (s.length - 2) / 2;
      var fi = s.substr(2, ek);
      var gE = s.substr(ek + 2, ek);
      return new K(this, this.dU(new O(fi, 16)), this.dU(new O(gE, 16)));
    default:
      return null;
  }
};
bw.prototype.qD = dp;
bw.prototype.vo = dg;
bw.prototype.wX = bY;
bw.prototype.el = df;
bw.prototype.gS = cI;
bw.prototype.dU = cK;
bw.prototype.rI = cD;
if (typeof Aostar == "undefined" || !Aostar) var Aostar = {};
if (typeof Aostar.crypto == "undefined" || !Aostar.crypto) Aostar.crypto = {};
Aostar.crypto.fH = function (dk) {
  var fp = "secp256r1";
  var fC = null;
  var er = null;
  var cY = null;
  var nX = new ab();
  var wh = null;
  this.type = "EC";

  function cV(P, k, Q, l) {
    var m = Math.max(k.eV(), l.eV());
    var Z = P.gA(Q);
    var R = P.cj.gS();
    for (var i = m - 1; i >= 0; --i) {
      R = R.qh();
      R.z = O.ONE;
      if (k.eJ(i)) {
        if (l.eJ(i)) {
          R = R.gA(Z);
        } else {
          R = R.gA(P);
        }
      } else {
        if (l.eJ(i)) {
          R = R.gA(Q);
        }
      }
    }
    return R;
  };
  this.im = function (kB) {
    return new O(kB.eV(), nX).ez(kB.eZ(O.ONE)).add(O.ONE);
  };
  this.mQ = function (fp) {
    this.fC = Aostar.crypto.hu.getByName(fp);
    this.er = null;
    this.cY = null;
    this.fp = fp;
  };
  this.kQ = function (er) {
    this.qK = true;
    this.er = er;
  };
  this.ki = function (cY) {
    this.qk = true;
    this.cY = cY;
  };
  this.yI = function () {
    var h = this.cY;
    if (h.substr(0, 2) !== "04") throw "this method supports uncompressed format(04) only";
    var fA = this.fC.hM / 4;
    if (h.length !== 2 + fA * 2) throw "malformed public key cf length";
    var result = {};
    result.x = h.substr(2, fA);
    result.y = h.substr(2 + fA);
    return result;
  };
  this.yE = function () {
    var s = this.fp;
    if (s === "secp256r1" || s === "NIST P-256" || s === "P-256" || s === "prime256v1") return "P-256";
    if (s === "secp384r1" || s === "NIST P-384" || s === "P-384") return "P-384";
    return null;
  };
  this.vj = function () {
    var iY = this.fC['n'];
    var dW = this.im(iY);
    var fU = this.fC['G'].multiply(dW);
    var ix = fU.fv().dG();
    var iC = fU.fw().dG();
    var fA = this.fC['hM'] / 4;
    var gf = ("0000000000" + dW.toString(16)).slice(-fA);
    var jm = ("0000000000" + ix.toString(16)).slice(-fA);
    var jf = ("0000000000" + iC.toString(16)).slice(-fA);
    var hf = "04" + jm + jf;
    this.kQ(gf);
    this.ki(hf);
    return {
      'ecprvhex': gf,
      'ecpubhex': hf
    };
  };
  this.generateKeyPairHex = function () {
    var dW;
    var iY = this.fC['n'];
    do {
      dW = this.im(iY);
    } while (dW.el(O.ZERO) || (dW.cS(iY) >= 0));
    var fU = this.fC['G'].multiply(dW);
    var ix = fU.fv().dG();
    var iC = fU.fw().dG();
    var fA = this.fC['hM'] / 4;
    var gf = ("0000000000" + dW.toString(16)).slice(-fA);
    var jm = ("0000000000" + ix.toString(16)).slice(-fA);
    var jf = ("0000000000" + iC.toString(16)).slice(-fA);
    var hf = "04" + jm + jf;
    this.kQ(gf);
    this.ki(hf);
    return {
      'ecprvhex': gf,
      'ecpubhex': hf
    };
  };
  this.tM = function (gX) {
    var dW = new O(gX, 16);
    var fU = this.fC['G'].multiply(dW);
    var ix = fU.fv().dG();
    var iC = fU.fw().dG();
    var fA = this.fC['hM'] / 4;
    var gf = ("0000000000" + dW.toString(16)).slice(-fA);
    var jm = ("0000000000" + ix.toString(16)).slice(-fA);
    var jf = ("0000000000" + iC.toString(16)).slice(-fA);
    var hf = "04" + jm + jf;
    return {
      'ecprvhex': gf,
      'ecpubhex': hf
    };
  };
  this.mZ = function (fl) {
    return this.iw(fl, this.er);
  };
  this.iw = function (fl, mv) {
    var d = new O(mv, 16);
    var n = this.fC['n'];
    var e = new O(fl, 16);
    do {
      var k = this.im(n);
      var G = this.fC['G'];
      var Q = G.multiply(k);
      var r = Q.fv().dG().ez(n);
    } while (r.cS(O.ZERO) <= 0);
    var s = k.ij(n).multiply(e.add(d.multiply(r))).ez(n);
    return Aostar.crypto.fH.pj(r, s);
  };
  this.gq = function (hash, lQ) {
    var d = lQ;
    var n = this.fC['n'];
    var e = O.gO(hash);
    do {
      var k = this.im(n);
      var G = this.fC['G'];
      var Q = G.multiply(k);
      var r = Q.fv().dG().ez(n);
    } while (r.cS(O.ZERO) <= 0);
    var s = k.ij(n).multiply(e.add(d.multiply(r))).ez(n);
    return this.om(r, s);
  };
  this.mt = function (fl, fL) {
    return this.kU(fl, fL, this.cY);
  };
  this.kU = function (fl, fL, he) {
    var r, s;
    var eh = Aostar.crypto.fH.sY(fL);
    r = eh.r;
    s = eh.s;
    var Q;
    Q = K.kn(this.fC['cj'], he);
    var e = new O(fl, 16);
    return this.kG(e, r, s, Q);
  };
  this.iP = function (hash, ca, gK) {
    var r, s;
    if (oS.hl.isArray(ca)) {
      var eh = this.mN(ca);
      r = eh.r;
      s = eh.s;
    } else if ("object" === typeof ca && ca.r && ca.s) {
      r = ca.r;
      s = ca.s;
    } else {
      throw "Invalid value for signature";
    }
    var Q;
    if (gK instanceof K) {
      Q = gK;
    } else if (oS.hl.isArray(gK)) {
      Q = K.pB(this.fC['cj'], gK);
    } else {
      throw "Invalid format for gK value, must be byte array fq K";
    }
    var e = O.gO(hash);
    return this.kG(e, r, s, Q);
  };
  this.kG = function (e, r, s, Q) {
    var n = this.fC['n'];
    var G = this.fC['G'];
    if (r.cS(O.ONE) < 0 || r.cS(n) >= 0) return false;
    if (s.cS(O.ONE) < 0 || s.cS(n) >= 0) return false;
    var c = s.ij(n);
    var vd = e.multiply(c).ez(n);
    var uC = r.multiply(c).ez(n);
    var po = G.multiply(vd).add(Q.multiply(uC));
    var v = po.fv().dG().ez(n);
    return v.el(r);
  };
  this.om = function (r, s) {
    var gN = r.ni();
    var gb = s.ni();
    var eU = [];
    eU.push(0x02);
    eU.push(gN.length);
    eU = eU.concat(gN);
    eU.push(0x02);
    eU.push(gb.length);
    eU = eU.concat(gb);
    eU.unshift(eU.length);
    eU.unshift(0x30);
    return eU;
  };
  this.mN = function (ca) {
    var cursor;
    if (ca[0] != 0x30) throw new Error("gL not a valid iU");
    cursor = 2;
    if (ca[cursor] != 0x02) throw new Error("First element in signature must be a gu");;
    var gN = ca.slice(cursor + 2, cursor + 2 + ca[cursor + 1]);
    cursor += 2 + ca[cursor + 1];
    if (ca[cursor] != 0x02) throw new Error("Second element in signature must be a gu");
    var gb = ca.slice(cursor + 2, cursor + 2 + ca[cursor + 1]);
    cursor += 2 + ca[cursor + 1];
    var r = O.gO(gN);
    var s = O.gO(gb);
    return {
      r: r,
      s: s
    };
  };
  this.vl = function (ca) {
    if (ca.length !== 65) {
      throw "gL has the wrong length";
    }
    var i = ca[0] - 27;
    if (i < 0 || i > 7) {
      throw "Invalid signature type";
    }
    var n = this.fC['n'];
    var r = O.gO(ca.slice(1, 33)).ez(n);
    var s = O.gO(ca.slice(33, 65)).ez(n);
    return {
      r: r,
      s: s,
      i: i
    };
  };
  if (dk !== undefined) {
    if (dk['cj'] !== undefined) {
      this.fp = dk['cj'];
    }
  }
  if (this.fp === undefined) this.fp = fp;
  this.mQ(this.fp);
  if (dk !== undefined) {
    if (dk['prv'] !== undefined) this.kQ(dk['prv']);
    if (dk['pub'] !== undefined) this.ki(dk['pub']);
  }
};
Aostar.crypto.fH.sY = function (fL) {
  var p = Aostar.crypto.fH.rE(fL);
  var jR = new O(p.r, 16);
  var ku = new O(p.s, 16);
  return {
    'r': jR,
    's': ku
  };
};
Aostar.crypto.fH.rE = function (fL) {
  if (fL.substr(0, 2) != "30") throw "signature is not a ASN.1 eU";
  var a = cT.iT(fL, 0);
  if (a.length != 2) throw "number of signature ASN.1 eU elements seem wrong";
  var pZ = a[0];
  var qH = a[1];
  if (fL.substr(pZ, 2) != "02") throw "1st item of sequene of signature is not ASN.1 integer";
  if (fL.substr(qH, 2) != "02") throw "2nd item of sequene of signature is not ASN.1 integer";
  var hR = cT.fg(fL, pZ);
  var gU = cT.fg(fL, qH);
  return {
    'r': hR,
    's': gU
  };
};
Aostar.crypto.fH.vw = function (tu) {
  var ra = Aostar.crypto.fH.rE(tu);
  var hR = ra.r;
  var gU = ra.s;
  if (hR.substr(0, 2) == "00" && (((hR.length / 2) * 8) % (16 * 8)) == 8) hR = hR.substr(2);
  if (gU.substr(0, 2) == "00" && (((gU.length / 2) * 8) % (16 * 8)) == 8) gU = gU.substr(2);
  if ((((hR.length / 2) * 8) % (16 * 8)) != 0) throw "unknown fH ca r length error";
  if ((((gU.length / 2) * 8) % (16 * 8)) != 0) throw "unknown fH ca s length error";
  return hR + gU;
};
Aostar.crypto.fH.yu = function (ld) {
  if ((((ld.length / 2) * 8) % (16 * 8)) != 0) throw "unknown fH concatinated r-s ca  length error";
  var hR = ld.substr(0, ld.length / 2);
  var gU = ld.substr(ld.length / 2);
  return Aostar.crypto.fH.vk(hR, gU);
};
Aostar.crypto.fH.vk = function (hR, gU) {
  var jR = new O(hR, 16);
  var ku = new O(gU, 16);
  return Aostar.crypto.fH.pj(jR, ku);
};
Aostar.crypto.fH.pj = function (jR, ku) {
  var sJ = new Aostar.dF.gu({
    'kA': jR
  });
  var wZ = new Aostar.dF.gu({
    'kA': ku
  });
  var wb = new Aostar.dF.iU({
    'array': [sJ, wZ]
  });
  return wb.hn();
};
J.prototype.wA = function () {
  return Math.floor((this.dG().eV() + 7) / 8);
};
K.prototype.xB = function (uh) {
  var rW = function (i, ek) {
    var fe = i.yl();
    if (ek < fe.length) {
      fe = fe.slice(fe.length - ek);
    } else
      while (ek > fe.length) {
        fe.unshift(0);
      }
    return fe;
  };
  var x = this.fv().dG();
  var y = this.fw().dG();
  var dX = rW(x, 32);
  if (uh) {
    if (y.fG()) {
      dX.unshift(0x02);
    } else {
      dX.unshift(0x03);
    }
  } else {
    dX.unshift(0x04);
    dX = dX.concat(rW(y, 32));
  }
  return dX;
};
K.pB = function (cj, dX) {
  var type = dX[0];
  var iq = dX.length - 1;
  var sD = dX.slice(1, 1 + iq / 2);
  var pA = dX.slice(1 + iq / 2, 1 + iq);
  sD.unshift(0);
  pA.unshift(0);
  var x = new O(sD);
  var y = new O(pA);
  return new K(cj, cj.dU(x), cj.dU(y));
};
K.kn = function (cj, ng) {
  var type = ng.substr(0, 2);
  var iq = ng.length - 2;
  var fi = ng.substr(2, iq / 2);
  var gE = ng.substr(2 + iq / 2, iq / 2);
  var x = new O(fi, 16);
  var y = new O(gE, 16);
  return new K(cj, cj.dU(x), cj.dU(y));
};
K.prototype.gA = function (b) {
  if (this.gG()) return b;
  if (b.gG()) return this;
  if (this.x.el(b.x)) {
    if (this.y.el(b.y)) {
      return this.kK();
    }
    return this.cj.gS();
  }
  var sd = b.x.eZ(this.x);
  var va = b.y.eZ(this.y);
  var kw = va.divide(sd);
  var gi = kw.square().eZ(this.x).eZ(b.x);
  var jD = kw.multiply(this.x.eZ(gi)).eZ(this.y);
  return new K(this.cj, gi, jD);
};
K.prototype.qh = function () {
  if (this.gG()) return this;
  if (this.y.dG().es() == 0) {
    return this.cj.gS();
  }
  var qN = this.cj.dU(O.valueOf(2));
  var kd = this.cj.dU(O.valueOf(3));
  var kw = this.x.square().multiply(kd).add(this.cj.a).divide(this.y.multiply(qN));
  var gi = kw.square().eZ(this.x.multiply(qN));
  var jD = kw.multiply(this.x.eZ(gi)).eZ(this.y);
  return new K(this.cj, gi, jD);
};
K.prototype.wB = function (k) {
  if (this.gG()) return this;
  if (k.es() == 0) return this.cj.gS();
  var e = k;
  var h = e.multiply(new O("3"));
  var pq = this.gR();
  var R = this;
  var i;
  for (i = h.eV() - 2; i > 0; --i) {
    R = R.kK();
    var kg = h.eJ(i);
    var oR = e.eJ(i);
    if (kg != oR) {
      R = R.gA(kg ? this : pq);
    }
  }
  return R;
};
K.prototype.wJ = function () {
  var x = this.fv().dG();
  var y = this.fw().dG();
  var a = this.cj.vo().dG();
  var b = this.cj.wX().dG();
  var n = this.cj.qD();
  var lhs = y.multiply(y).ez(n);
  var rhs = x.multiply(x).multiply(x).add(a.multiply(x)).add(b).ez(n);
  return lhs.el(rhs);
};
K.prototype.toString = function () {
  return '(' + this.fv().dG().toString() + ',' + this.fw().dG().toString() + ')';
};
K.prototype.yX = function () {
  var n = this.cj.qD();
  if (this.gG()) {
    throw new Error("Point is at nJ.");
  }
  var x = this.fv().dG();
  var y = this.fw().dG();
  if (x.cS(O.ONE) < 0 || x.cS(n.eZ(O.ONE)) > 0) {
    throw new Error('x coordinate out of bounds');
  }
  if (y.cS(O.ONE) < 0 || y.cS(n.eZ(O.ONE)) > 0) {
    throw new Error('y coordinate out of bounds');
  }
  if (!this.wJ()) {
    throw new Error("Point is not on the cj.");
  }
  if (this.multiply(n).gG()) {
    throw new Error("Point is not a scalar multiple of G.");
  }
  return true;
};
var jt;
var uf = 0xdeadbeefcafe;
var qZ = ((uf & 0xffffff) == 0xefcafe);

function O(a, b, c) {
  if (a != null)
    if ("number" == typeof a) this.mK(a, b, c);
    else if (b == null && "string" != typeof a) this.nj(a, 256);
  else this.nj(a, b);
};

function T() {
  return new O(null);
};

function cr(i, x, w, j, c, n) {
  while (--n >= 0) {
    var v = x * this[i++] + w[j] + c;
    c = Math.floor(v / 0x4000000);
    w[j++] = v & 0x3ffffff;
  }
  return c;
};

function dA(i, x, w, j, c, n) {
  var kz = x & 0x7fff,
    kO = x >> 15;
  for (var so = n; so--; so >= 0) {
    var l = this[i] & 0x7fff;
    var h = this[i++] >> 15;
    var m = kO * l + h * kz;
    l = kz * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);
    c = (l >>> 30) + (m >>> 15) + kO * h + (c >>> 30);
    w[j++] = l & 0x3fffffff;
  }
  return c;
};

function cl(i, x, w, j, c, n) {
  var kz = x & 0x3fff,
    kO = x >> 14;
  while (--n >= 0) {
    var l = this[i] & 0x3fff;
    var h = this[i++] >> 14;
    var m = kO * l + h * kz;
    l = kz * l + ((m & 0x3fff) << 14) + w[j] + c;
    c = (l >> 28) + (m >> 14) + kO * h;
    w[j++] = l & 0xfffffff;
  }
  return c;
};
var qT = typeof navigator !== "undefined";
if (qT && qZ && (navigator.appName == "Microsoft Internet Explorer")) {
  O.prototype.fs = dA;
  jt = 30;
} else if (qT && qZ && (navigator.appName != "Netscape")) {
  O.prototype.fs = cr;
  jt = 26;
} else {
  O.prototype.fs = cl;
  jt = 28;
}
O.prototype.cu = jt;
O.prototype.eS = ((1 << jt) - 1);
O.prototype.eg = (1 << jt);
var oA = 52;
O.prototype.vF = Math.pow(2, oA);
O.prototype.qq = oA - jt;
O.prototype.qF = 2 * jt - oA;
var ug = "0123456789abcdefghijklmnopqrstuvwxyz";
var mX = new Array();
var lh, eo;
lh = "0".charCodeAt(0);
for (eo = 0; eo <= 9; ++eo) mX[lh++] = eo;
lh = "a".charCodeAt(0);
for (eo = 10; eo < 36; ++eo) mX[lh++] = eo;
lh = "A".charCodeAt(0);
for (eo = 10; eo < 36; ++eo) mX[lh++] = eo;

function an(n) {
  return ug.charAt(n);
};

function aL(s, i) {
  var c = mX[s.charCodeAt(i)];
  return (c == null) ? -1 : c;
};

function cL(r) {
  for (var i = this.t - 1; i >= 0; --i) r[i] = this[i];
  r.t = this.t;
  r.s = this.s;
};

function cC(x) {
  this.t = 1;
  this.s = (x < 0) ? -1 : 0;
  if (x > 0) this[0] = x;
  else if (x < -1) this[0] = x + this.eg;
  else this.t = 0;
};

function by(i) {
  var r = T();
  r.gH(i);
  return r;
};

function ci(s, b) {
  var k;
  if (b == 16) k = 4;
  else if (b == 8) k = 3;
  else if (b == 256) k = 8;
  else if (b == 2) k = 1;
  else if (b == 32) k = 5;
  else if (b == 4) k = 2;
  else {
    this.qX(s, b);
    return;
  }
  this.t = 0;
  this.s = 0;
  var i = s.length,
    iV = false,
    hE = 0;
  while (--i >= 0) {
    var x = (k == 8) ? s[i] & 0xff : aL(s, i);
    if (x < 0) {
      if (s.charAt(i) == "-") iV = true;
      continue;
    }
    iV = false;
    if (hE == 0) this[this.t++] = x;
    else if (hE + k > this.cu) {
      this[this.t - 1] |= (x & ((1 << (this.cu - hE)) - 1)) << hE;
      this[this.t++] = (x >> (this.cu - hE));
    } else this[this.t - 1] |= x << hE;
    hE += k;
    if (hE >= this.cu) hE -= this.cu;
  }
  if (k == 8 && (s[0] & 0x80) != 0) {
    this.s = -1;
    if (hE > 0) this[this.t - 1] |= ((1 << (this.cu - hE)) - 1) << hE;
  }
  this.eE();
  if (iV) O.ZERO.fB(this, this);
};

function cU() {
  var c = this.s & this.eS;
  while (this.t > 0 && this[this.t - 1] == c) --this.t;
};

function cb(b) {
  if (this.s < 0) return "-" + this.gR().toString(b);
  var k;
  if (b == 16) k = 4;
  else if (b == 8) k = 3;
  else if (b == 2) k = 1;
  else if (b == 32) k = 5;
  else if (b == 4) k = 2;
  else return this.fD(b);
  var jo = (1 << k) - 1,
    d, m = false,
    r = "",
    i = this.t;
  var p = this.cu - (i * this.cu) % k;
  if (i-- > 0) {
    if (p < this.cu && (d = this[i] >> p) > 0) {
      m = true;
      r = an(d);
    }
    while (i >= 0) {
      if (p < k) {
        d = (this[i] & ((1 << p) - 1)) << (k - p);
        d |= this[--i] >> (p += this.cu - k);
      } else {
        d = (this[i] >> (p -= k)) & jo;
        if (p <= 0) {
          p += this.cu;
          --i;
        }
      }
      if (d > 0) m = true;
      if (m) r += an(d);
    }
  }
  return m ? r : "0";
};

function cJ() {
  var r = T();
  O.ZERO.fB(this, r);
  return r;
};

function cX() {
  return (this.s < 0) ? this.gR() : this;
};

function cG(a) {
  var r = this.s - a.s;
  if (r != 0) return r;
  var i = this.t;
  r = i - a.t;
  if (r != 0) return (this.s < 0) ? -r : r;
  while (--i >= 0)
    if ((r = this[i] - a[i]) != 0) return r;
  return 0;
};

function aP(x) {
  var r = 1,
    t;
  if ((t = x >>> 16) != 0) {
    x = t;
    r += 16;
  }
  if ((t = x >> 8) != 0) {
    x = t;
    r += 8;
  }
  if ((t = x >> 4) != 0) {
    x = t;
    r += 4;
  }
  if ((t = x >> 2) != 0) {
    x = t;
    r += 2;
  }
  if ((t = x >> 1) != 0) {
    x = t;
    r += 1;
  }
  return r;
};

function cz() {
  if (this.t <= 0) return 0;
  return this.cu * (this.t - 1) + aP(this[this.t - 1] ^ (this.s & this.eS));
};

function cv(n, r) {
  var i;
  for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i];
  for (i = n - 1; i >= 0; --i) r[i] = 0;
  r.t = this.t + n;
  r.s = this.s;
};

function cF(n, r) {
  for (var i = n; i < this.t; ++i) r[i - n] = this[i];
  r.t = Math.max(this.t - n, 0);
  r.s = this.s;
};

function ck(n, r) {
  var hA = n % this.cu;
  var kx = this.cu - hA;
  var nm = (1 << kx) - 1;
  var hD = Math.floor(n / this.cu),
    c = (this.s << hA) & this.eS,
    i;
  for (i = this.t - 1; i >= 0; --i) {
    r[i + hD + 1] = (this[i] >> kx) | c;
    c = (this[i] & nm) << hA;
  }
  for (i = hD - 1; i >= 0; --i) r[i] = 0;
  r[hD] = c;
  r.t = this.t + hD + 1;
  r.s = this.s;
  r.eE();
};

function cN(n, r) {
  r.s = this.s;
  var hD = Math.floor(n / this.cu);
  if (hD >= this.t) {
    r.t = 0;
    return;
  }
  var hA = n % this.cu;
  var kx = this.cu - hA;
  var nm = (1 << hA) - 1;
  r[0] = this[hD] >> hA;
  for (var i = hD + 1; i < this.t; ++i) {
    r[i - hD - 1] |= (this[i] & nm) << kx;
    r[i - hD] = this[i] >> hA;
  }
  if (hA > 0) r[this.t - hD - 1] |= (this.s & nm) << kx;
  r.t = this.t - hD;
  r.eE();
};

function cc(a, r) {
  var i = 0,
    c = 0,
    m = Math.min(a.t, this.t);
  while (i < m) {
    c += this[i] - a[i];
    r[i++] = c & this.eS;
    c >>= this.cu;
  }
  if (a.t < this.t) {
    c -= a.s;
    while (i < this.t) {
      c += this[i];
      r[i++] = c & this.eS;
      c >>= this.cu;
    }
    c += this.s;
  } else {
    c += this.s;
    while (i < a.t) {
      c -= a[i];
      r[i++] = c & this.eS;
      c >>= this.cu;
    }
    c -= a.s;
  }
  r.s = (c < 0) ? -1 : 0;
  if (c < -1) r[i++] = this.eg + c;
  else if (c > 0) r[i++] = c;
  r.t = i;
  r.eE();
};

function bX(a, r) {
  var x = this.abs(),
    y = a.abs();
  var i = x.t;
  r.t = i + y.t;
  while (--i >= 0) r[i] = 0;
  for (i = 0; i < y.t; ++i) r[i + x.t] = x.fs(0, y[i], r, i, 0, x.t);
  r.s = 0;
  r.eE();
  if (this.s != a.s) O.ZERO.fB(r, r);
};

function dQ(r) {
  var x = this.abs();
  var i = r.t = 2 * x.t;
  while (--i >= 0) r[i] = 0;
  for (i = 0; i < x.t - 1; ++i) {
    var c = x.fs(i, x[i], r, 2 * i, 0, 1);
    if ((r[i + x.t] += x.fs(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.eg) {
      r[i + x.t] -= x.eg;
      r[i + x.t + 1] = 1;
    }
  }
  if (r.t > 0) r[r.t - 1] += x.fs(i, x[i], r, 2 * i, 0, 1);
  r.s = 0;
  r.eE();
};

function dO(m, q, r) {
  var jY = m.abs();
  if (jY.t <= 0) return;
  var pt = this.abs();
  if (pt.t < jY.t) {
    if (q != null) q.gH(0);
    if (r != null) this.fT(r);
    return;
  }
  if (r == null) r = T();
  var y = T(),
    pw = this.s,
    ms = m.s;
  var kj = this.cu - aP(jY[jY.t - 1]);
  if (kj > 0) {
    jY.jB(kj, y);
    pt.jB(kj, r);
  } else {
    jY.fT(y);
    pt.fT(r);
  }
  var hi = y.t;
  var pi = y[hi - 1];
  if (pi == 0) return;
  var qa = pi * (1 << this.qq) + ((hi > 1) ? y[hi - 2] >> this.qF : 0);
  var uT = this.vF / qa,
    tz = (1 << this.qq) / qa,
    e = 1 << this.qF;
  var i = r.t,
    j = i - hi,
    t = (q == null) ? T() : q;
  y.it(j, t);
  if (r.cS(t) >= 0) {
    r[r.t++] = 1;
    r.fB(t, r);
  }
  O.ONE.it(hi, t);
  t.fB(y, y);
  while (y.t < hi) y[y.t++] = 0;
  while (--j >= 0) {
    var ob = (r[--i] == pi) ? this.eS : Math.floor(r[i] * uT + (r[i - 1] + e) * tz);
    if ((r[i] += y.fs(0, ob, r, j, 0, hi)) < ob) {
      y.it(j, t);
      r.fB(t, r);
      while (r[i] < --ob) r.fB(t, r);
    }
  }
  if (q != null) {
    r.kC(hi, q);
    if (pw != ms) O.ZERO.fB(q, q);
  }
  r.t = hi;
  r.eE();
  if (kj > 0) r.fc(kj, r);
  if (pw < 0) O.ZERO.fB(r, r);
};

function co(a) {
  var r = T();
  this.abs().hI(a, null, r);
  if (this.s < 0 && r.cS(O.ZERO) > 0) a.fB(r, r);
  return r;
};

function aZ(m) {
  this.m = m;
};

function dI(x) {
  if (x.s < 0 || x.cS(this.m) >= 0) return x.ez(this.m);
  else return x;
};

function cW(x) {
  return x;
};

function cQ(x) {
  x.hI(this.m, null, x);
};

function dC(x, y, r) {
  x.je(y, r);
  this.reduce(r);
};

function ce(x, r) {
  x.io(r);
  this.reduce(r);
};
aZ.prototype.convert = dI;
aZ.prototype.revert = cW;
aZ.prototype.reduce = cQ;
aZ.prototype.gj = dC;
aZ.prototype.eu = ce;

function dn() {
  if (this.t < 1) return 0;
  var x = this[0];
  if ((x & 1) == 0) return 0;
  var y = x & 3;
  y = (y * (2 - (x & 0xf) * y)) & 0xf;
  y = (y * (2 - (x & 0xff) * y)) & 0xff;
  y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff;
  y = (y * (2 - x * y % this.eg)) % this.eg;
  return (y > 0) ? this.eg - y : -y;
};

function aR(m) {
  this.m = m;
  this.sq = m.uI();
  this.sn = this.sq & 0x7fff;
  this.ue = this.sq >> 15;
  this.uS = (1 << (m.cu - 15)) - 1;
  this.uO = 2 * m.t;
};

function cP(x) {
  var r = T();
  x.abs().it(this.m.t, r);
  r.hI(this.m, null, r);
  if (x.s < 0 && r.cS(O.ZERO) > 0) this.m.fB(r, r);
  return r;
};

function cd(x) {
  var r = T();
  x.fT(r);
  this.reduce(r);
  return r;
};

function dE(x) {
  while (x.t <= this.uO) x[x.t++] = 0;
  for (var i = 0; i < this.m.t; ++i) {
    var j = x[i] & 0x7fff;
    var uv = (j * this.sn + (((j * this.ue + (x[i] >> 15) * this.sn) & this.uS) << 15)) & x.eS;
    j = i + this.m.t;
    x[j] += this.m.fs(0, uv, x, i, 0, this.m.t);
    while (x[j] >= x.eg) {
      x[j] -= x.eg;
      x[++j]++;
    }
  }
  x.eE();
  x.kC(this.m.t, x);
  if (x.cS(this.m) >= 0) x.fB(this.m, x);
};

function dK(x, r) {
  x.io(r);
  this.reduce(r);
};

function aW(x, y, r) {
  x.je(y, r);
  this.reduce(r);
};
aR.prototype.convert = cP;
aR.prototype.revert = cd;
aR.prototype.reduce = dE;
aR.prototype.gj = aW;
aR.prototype.eu = dK;

function dz() {
  return ((this.t > 0) ? (this[0] & 1) : this.s) == 0;
};

function dH(e, z) {
  if (e > 0xffffffff || e < 1) return O.ONE;
  var r = T(),
    r2 = T(),
    g = z.convert(this),
    i = aP(e) - 1;
  g.fT(r);
  while (--i >= 0) {
    z.eu(r, r2);
    if ((e & (1 << i)) > 0) z.gj(r2, g, r);
    else {
      var t = r;
      r = r2;
      r2 = t;
    }
  }
  return z.revert(r);
};

function dj(e, m) {
  var z;
  if (e < 256 || m.fG()) z = new aZ(m);
  else z = new aR(m);
  return this.exp(e, z);
};
O.prototype.fT = cL;
O.prototype.gH = cC;
O.prototype.nj = ci;
O.prototype.eE = cU;
O.prototype.it = cv;
O.prototype.kC = cF;
O.prototype.jB = ck;
O.prototype.fc = cN;
O.prototype.fB = cc;
O.prototype.je = bX;
O.prototype.io = dQ;
O.prototype.hI = dO;
O.prototype.uI = dn;
O.prototype.fG = dz;
O.prototype.exp = dH;
O.prototype.toString = cb;
O.prototype.gR = cJ;
O.prototype.abs = cX;
O.prototype.cS = cG;
O.prototype.eV = cz;
O.prototype.ez = co;
O.prototype.rX = dj;
O.ZERO = by(0);
O.ONE = by(1);

function ag() {
  var r = T();
  this.fT(r);
  return r;
};

function ad() {
  if (this.s < 0) {
    if (this.t == 1) return this[0] - this.eg;
    else if (this.t == 0) return -1;
  } else if (this.t == 1) return this[0];
  else if (this.t == 0) return 0;
  return ((this[1] & ((1 << (32 - this.cu)) - 1)) << this.cu) | this[0];
};

function bP() {
  return (this.t == 0) ? this.s : (this[0] << 24) >> 24;
};

function bV() {
  return (this.t == 0) ? this.s : (this[0] << 16) >> 16;
};

function aK(r) {
  return Math.floor(Math.LN2 * this.cu / Math.log(r));
};

function ao() {
  if (this.s < 0) return -1;
  else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;
  else return 1;
};

function aN(b) {
  if (b == null) b = 10;
  if (this.es() == 0 || b < 2 || b > 36) return "0";
  var gW = this.kc(b);
  var a = Math.pow(b, gW);
  var d = by(a),
    y = T(),
    z = T(),
    r = "";
  this.hI(d, y, z);
  while (y.es() > 0) {
    r = (a + z.hk()).toString(b).substr(1) + r;
    y.hI(d, y, z);
  }
  return z.hk().toString(b) + r;
};

function bC(s, b) {
  this.gH(0);
  if (b == null) b = 10;
  var gW = this.kc(b);
  var d = Math.pow(b, gW),
    iV = false,
    j = 0,
    w = 0;
  for (var i = 0; i < s.length; ++i) {
    var x = aL(s, i);
    if (x < 0) {
      if (s.charAt(i) == "-" && this.es() == 0) iV = true;
      continue;
    }
    w = b * w + x;
    if (++j >= gW) {
      this.ks(d);
      this.hg(w, 0);
      j = 0;
      w = 0;
    }
  }
  if (j > 0) {
    this.ks(Math.pow(b, j));
    this.hg(w, 0);
  }
  if (iV) O.ZERO.fB(this, this);
};

function aA(a, b, c) {
  if ("number" == typeof b) {
    if (a < 2) this.gH(1);
    else {
      this.mK(a, c);
      if (!this.eJ(a - 1)) this.gI(O.ONE.shiftLeft(a - 1), ap, this);
      if (this.fG()) this.hg(1, 0);
      while (!this.qc(b)) {
        this.hg(2, 0);
        if (this.eV() > a) this.fB(O.ONE.shiftLeft(a - 1), this);
      }
    }
  } else {
    var x = new Array(),
      t = a & 7;
    x.length = (a >> 3) + 1;
    b.oJ(x);
    if (t > 0) x[0] &= ((1 << t) - 1);
    else x[0] = 0;
    this.nj(x, 256);
  }
};

function bM() {
  var i = this.t,
    r = new Array();
  r[0] = this.s;
  var p = this.cu - (i * this.cu) % 8,
    d, k = 0;
  if (i-- > 0) {
    if (p < this.cu && (d = this[i] >> p) != (this.s & this.eS) >> p) r[k++] = d | (this.s << (this.cu - p));
    while (i >= 0) {
      if (p < 8) {
        d = (this[i] & ((1 << p) - 1)) << (8 - p);
        d |= this[--i] >> (p += this.cu - 8);
      } else {
        d = (this[i] >> (p -= 8)) & 0xff;
        if (p <= 0) {
          p += this.cu;
          --i;
        }
      }
      if ((d & 0x80) != 0) d |= -256;
      if (k == 0 && (this.s & 0x80) != (d & 0x80)) ++k;
      if (k > 0 || d != this.s) r[k++] = d;
    }
  }
  return r;
};

function au(a) {
  return (this.cS(a) == 0);
};

function aF(a) {
  return (this.cS(a) < 0) ? this : a;
};

function bv(a) {
  return (this.cS(a) > 0) ? this : a;
};

function aI(a, gB, r) {
  var i, f, m = Math.min(a.t, this.t);
  for (i = 0; i < m; ++i) r[i] = gB(this[i], a[i]);
  if (a.t < this.t) {
    f = a.s & this.eS;
    for (i = m; i < this.t; ++i) r[i] = gB(this[i], f);
    r.t = this.t;
  } else {
    f = this.s & this.eS;
    for (i = m; i < a.t; ++i) r[i] = gB(f, a[i]);
    r.t = a.t;
  }
  r.s = gB(this.s, a.s);
  r.eE();
};

function bJ(x, y) {
  return x & y;
};

function bO(a) {
  var r = T();
  this.gI(a, bJ, r);
  return r;
};

function ap(x, y) {
  return x | y;
};

function bz(a) {
  var r = T();
  this.gI(a, ap, r);
  return r;
};

function aS(x, y) {
  return x ^ y;
};

function aD(a) {
  var r = T();
  this.gI(a, aS, r);
  return r;
};

function bQ(x, y) {
  return x & ~y;
};

function bK(a) {
  var r = T();
  this.gI(a, bQ, r);
  return r;
};

function ak() {
  var r = T();
  for (var i = 0; i < this.t; ++i) r[i] = this.eS & ~this[i];
  r.t = this.t;
  r.s = ~this.s;
  return r;
};

function bx(n) {
  var r = T();
  if (n < 0) this.fc(-n, r);
  else this.jB(n, r);
  return r;
};

function be(n) {
  var r = T();
  if (n < 0) this.jB(-n, r);
  else this.fc(n, r);
  return r;
};

function ah(x) {
  if (x == 0) return -1;
  var r = 0;
  if ((x & 0xffff) == 0) {
    x >>= 16;
    r += 16;
  }
  if ((x & 0xff) == 0) {
    x >>= 8;
    r += 8;
  }
  if ((x & 0xf) == 0) {
    x >>= 4;
    r += 4;
  }
  if ((x & 3) == 0) {
    x >>= 2;
    r += 2;
  }
  if ((x & 1) == 0) ++r;
  return r;
};

function bB() {
  for (var i = 0; i < this.t; ++i)
    if (this[i] != 0) return i * this.cu + ah(this[i]);
  if (this.s < 0) return this.t * this.cu;
  return -1;
};

function ai(x) {
  var r = 0;
  while (x != 0) {
    x &= x - 1;
    ++r;
  }
  return r;
};

function aC() {
  var r = 0,
    x = this.s & this.eS;
  for (var i = 0; i < this.t; ++i) r += ai(this[i] ^ x);
  return r;
};

function aO(n) {
  var j = Math.floor(n / this.cu);
  if (j >= this.t) return (this.s != 0);
  return ((this[j] & (1 << (n % this.cu))) != 0);
};

function bU(n, gB) {
  var r = O.ONE.shiftLeft(n);
  this.gI(r, gB, r);
  return r;
};

function bd(n) {
  return this.jg(n, ap);
};

function aQ(n) {
  return this.jg(n, bQ);
};

function bF(n) {
  return this.jg(n, aS);
};

function bj(a, r) {
  var i = 0,
    c = 0,
    m = Math.min(a.t, this.t);
  while (i < m) {
    c += this[i] + a[i];
    r[i++] = c & this.eS;
    c >>= this.cu;
  }
  if (a.t < this.t) {
    c += a.s;
    while (i < this.t) {
      c += this[i];
      r[i++] = c & this.eS;
      c >>= this.cu;
    }
    c += this.s;
  } else {
    c += this.s;
    while (i < a.t) {
      c += a[i];
      r[i++] = c & this.eS;
      c >>= this.cu;
    }
    c += a.s;
  }
  r.s = (c < 0) ? -1 : 0;
  if (c > 0) r[i++] = c;
  else if (c < -1) r[i++] = this.eg + c;
  r.t = i;
  r.eE();
};

function bu(a) {
  var r = T();
  this.gx(a, r);
  return r;
};

function aE(a) {
  var r = T();
  this.fB(a, r);
  return r;
};

function aJ(a) {
  var r = T();
  this.je(a, r);
  return r;
};

function bn() {
  var r = T();
  this.io(r);
  return r;
};

function bN(a) {
  var r = T();
  this.hI(a, r, null);
  return r;
};

function bf(a) {
  var r = T();
  this.hI(a, null, r);
  return r;
};

function bo(a) {
  var q = T(),
    r = T();
  this.hI(a, q, r);
  return new Array(q, r);
};

function av(n) {
  this[this.t] = this.fs(0, n - 1, this, 0, 0, this.t);
  ++this.t;
  this.eE();
};

function bI(n, w) {
  if (n == 0) return;
  while (this.t <= w) this[this.t++] = 0;
  this[w] += n;
  while (this[w] >= this.eg) {
    this[w] -= this.eg;
    if (++w >= this.t) this[this.t++] = 0;
    ++this[w];
  }
};

function bg() {};

function aV(x) {
  return x;
};

function af(x, y, r) {
  x.je(y, r);
};

function aw(x, r) {
  x.io(r);
};
bg.prototype.convert = aV;
bg.prototype.revert = aV;
bg.prototype.gj = af;
bg.prototype.eu = aw;

function aj(e) {
  return this.exp(e, new bg());
};

function aX(a, n, r) {
  var i = Math.min(this.t + a.t, n);
  r.s = 0;
  r.t = i;
  while (i > 0) r[--i] = 0;
  var j;
  for (j = r.t - this.t; i < j; ++i) r[i + this.t] = this.fs(0, a[i], r, i, 0, this.t);
  for (j = Math.min(a.t, n); i < j; ++i) this.fs(0, a[i], r, i, 0, n - i);
  r.eE();
};

function bS(a, n, r) {
  --n;
  var i = r.t = this.t + a.t - n;
  r.s = 0;
  while (--i >= 0) r[i] = 0;
  for (i = Math.max(n - this.t, 0); i < a.t; ++i) r[this.t + i - n] = this.fs(n - i, a[i], r, 0, 0, this.t + i - n);
  r.eE();
  r.kC(1, r);
};

function ar(m) {
  this.r2 = T();
  this.kS = T();
  O.ONE.it(2 * m.t, this.r2);
  this.oV = this.r2.divide(m);
  this.m = m;
};

function aT(x) {
  if (x.s < 0 || x.t > 2 * this.m.t) return x.ez(this.m);
  else if (x.cS(this.m) < 0) return x;
  else {
    var r = T();
    x.fT(r);
    this.reduce(r);
    return r;
  }
};

function aY(x) {
  return x;
};

function bh(x) {
  x.kC(this.m.t - 1, this.r2);
  if (x.t > this.m.t + 1) {
    x.t = this.m.t + 1;
    x.eE();
  }
  this.oV.oW(this.r2, this.m.t + 1, this.kS);
  this.m.oZ(this.kS, this.m.t + 1, this.r2);
  while (x.cS(this.r2) < 0) x.hg(1, this.m.t + 1);
  x.fB(this.r2, x);
  while (x.cS(this.m) >= 0) x.fB(this.m, x);
};

function aH(x, r) {
  x.io(r);
  this.reduce(r);
};

function bk(x, y, r) {
  x.je(y, r);
  this.reduce(r);
};
ar.prototype.convert = aT;
ar.prototype.revert = aY;
ar.prototype.reduce = bh;
ar.prototype.gj = bk;
ar.prototype.eu = aH;

function aa(e, m) {
  var i = e.eV(),
    k, r = by(1),
    z;
  if (i <= 0) return r;
  else if (i < 18) k = 1;
  else if (i < 48) k = 3;
  else if (i < 144) k = 4;
  else if (i < 768) k = 5;
  else k = 6;
  if (i < 8) z = new aZ(m);
  else if (m.fG()) z = new ar(m);
  else z = new aR(m);
  var g = new Array(),
    n = 3,
    ha = k - 1,
    jo = (1 << k) - 1;
  g[1] = z.convert(this);
  if (k > 1) {
    var lv = T();
    z.eu(g[1], lv);
    while (n <= jo) {
      g[n] = T();
      z.gj(lv, g[n - 2], g[n]);
      n += 2;
    }
  }
  var j = e.t - 1,
    w, ke = true,
    r2 = T(),
    t;
  i = aP(e[j]) - 1;
  while (j >= 0) {
    if (i >= ha) w = (e[j] >> (i - ha)) & jo;
    else {
      w = (e[j] & ((1 << (i + 1)) - 1)) << (ha - i);
      if (j > 0) w |= e[j - 1] >> (this.cu + i - ha);
    }
    n = k;
    while ((w & 1) == 0) {
      w >>= 1;
      --n;
    }
    if ((i -= n) < 0) {
      i += this.cu;
      --j;
    }
    if (ke) {
      g[w].fT(r);
      ke = false;
    } else {
      while (n > 1) {
        z.eu(r, r2);
        z.eu(r2, r);
        n -= 2;
      }
      if (n > 0) z.eu(r, r2);
      else {
        t = r;
        r = r2;
        r2 = t;
      }
      z.gj(r2, g[w], r);
    }
    while (j >= 0 && (e[j] & (1 << i)) == 0) {
      z.eu(r, r2);
      t = r;
      r = r2;
      r2 = t;
      if (--i < 0) {
        i = this.cu - 1;
        --j;
      }
    }
  }
  return z.revert(r);
};

function bE(a) {
  var x = (this.s < 0) ? this.gR() : this.clone();
  var y = (a.s < 0) ? a.gR() : a.clone();
  if (x.cS(y) < 0) {
    var t = x;
    x = y;
    y = t;
  }
  var i = x.gv(),
    g = y.gv();
  if (g < 0) return x;
  if (i < g) g = i;
  if (g > 0) {
    x.fc(g, x);
    y.fc(g, y);
  }
  while (x.es() > 0) {
    if ((i = x.gv()) > 0) x.fc(i, x);
    if ((i = y.gv()) > 0) y.fc(i, y);
    if (x.cS(y) >= 0) {
      x.fB(y, x);
      x.fc(1, x);
    } else {
      y.fB(x, y);
      y.fc(1, y);
    }
  }
  if (g > 0) y.jB(g, y);
  return y;
};

function bA(n) {
  if (n <= 0) return 0;
  var d = this.eg % n,
    r = (this.s < 0) ? n - 1 : 0;
  if (this.t > 0)
    if (d == 0) r = this[0] % n;
    else
      for (var i = this.t - 1; i >= 0; --i) r = (d * r + this[i]) % n;
  return r;
};

function bG(m) {
  var hb = m.fG();
  if ((this.fG() && hb) || m.es() == 0) return O.ZERO;
  var u = m.clone(),
    v = this.clone();
  var a = by(1),
    b = by(0),
    c = by(0),
    d = by(1);
  while (u.es() != 0) {
    while (u.fG()) {
      u.fc(1, u);
      if (hb) {
        if (!a.fG() || !b.fG()) {
          a.gx(this, a);
          b.fB(m, b);
        }
        a.fc(1, a);
      } else if (!b.fG()) b.fB(m, b);
      b.fc(1, b);
    }
    while (v.fG()) {
      v.fc(1, v);
      if (hb) {
        if (!c.fG() || !d.fG()) {
          c.gx(this, c);
          d.fB(m, d);
        }
        c.fc(1, c);
      } else if (!d.fG()) d.fB(m, d);
      d.fc(1, d);
    }
    if (u.cS(v) >= 0) {
      u.fB(v, u);
      if (hb) a.fB(c, a);
      b.fB(d, b);
    } else {
      v.fB(u, v);
      if (hb) c.fB(a, c);
      d.fB(b, d);
    }
  }
  if (v.cS(O.ONE) != 0) return O.ZERO;
  if (d.cS(m) >= 0) return d.eZ(m);
  if (d.es() < 0) d.gx(m, d);
  else return d;
  if (d.es() < 0) return d.add(m);
  else return d;
};
var ee = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997];
var lO = (1 << 26) / ee[ee.length - 1];

function bq(t) {
  var i, x = this.abs();
  if (x.t == 1 && x[0] <= ee[ee.length - 1]) {
    for (i = 0; i < ee.length; ++i)
      if (x[0] == ee[i]) return true;
    return false;
  }
  if (x.fG()) return false;
  i = 1;
  while (i < ee.length) {
    var m = ee[i],
      j = i + 1;
    while (j < ee.length && m < lO) m *= ee[j++];
    m = x.nI(m);
    while (i < j)
      if (m % ee[i++] == 0) return false;
  }
  return x.ou(t);
};

function az(t) {
  var ho = this.eZ(O.ONE);
  var k = ho.gv();
  if (k <= 0) return false;
  var r = ho.kF(k);
  t = (t + 1) >> 1;
  if (t > ee.length) t = ee.length;
  var a = T();
  for (var i = 0; i < t; ++i) {
    a.gH(ee[Math.floor(AostarJS.dX.iK.js() * ee.length)]);
    var y = a.oi(r, this);
    if (y.cS(O.ONE) != 0 && y.cS(ho) != 0) {
      var j = 1;
      while (j++ < k && y.cS(ho) != 0) {
        y = y.rX(2, this);
        if (y.cS(O.ONE) == 0) return false;
      }
      if (y.cS(ho) != 0) return false;
    }
  }
  return true;
};
O.prototype.kc = aK;
O.prototype.fD = aN;
O.prototype.qX = bC;
O.prototype.mK = aA;
O.prototype.gI = aI;
O.prototype.jg = bU;
O.prototype.gx = bj;
O.prototype.ks = av;
O.prototype.hg = bI;
O.prototype.oZ = aX;
O.prototype.oW = bS;
O.prototype.nI = bA;
O.prototype.ou = az;
O.prototype.clone = ag;
O.prototype.hk = ad;
O.prototype.tf = bP;
O.prototype.vJ = bV;
O.prototype.es = ao;
O.prototype.uz = bM;
O.prototype.el = au;
O.prototype.min = aF;
O.prototype.max = bv;
O.prototype.and = bO;
O.prototype.fq = bz;
O.prototype.xor = aD;
O.prototype.tk = bK;
O.prototype.not = ak;
O.prototype.shiftLeft = bx;
O.prototype.kF = be;
O.prototype.gv = bB;
O.prototype.vc = aC;
O.prototype.eJ = aO;
O.prototype.vA = bd;
O.prototype.uM = aQ;
O.prototype.wL = bF;
O.prototype.add = bu;
O.prototype.eZ = aE;
O.prototype.multiply = aJ;
O.prototype.divide = bN;
O.prototype.vi = bf;
O.prototype.xb = bo;
O.prototype.oi = aa;
O.prototype.ij = bG;
O.prototype.pow = aj;
O.prototype.wI = bE;
O.prototype.qc = bq;
O.prototype.square = bn;
O.prototype.ar = ar;
var hj;
var ft;
var ew;

function aU(x) {
  ft[ew++] ^= x & 255;
  ft[ew++] ^= (x >> 8) & 255;
  ft[ew++] ^= (x >> 16) & 255;
  ft[ew++] ^= (x >> 24) & 255;
  if (ew >= iE) ew -= iE;
};

function ay() {
  aU(new Date().getTime());
};
if (ft == null) {
  ft = new Array();
  ew = 0;
  var t;
  if (typeof window !== "undefined" && window.crypto) {
    if (window.crypto.oe) {
      var ua = new Uint8Array(32);
      window.crypto.oe(ua);
      for (t = 0; t < 32; ++t) ft[ew++] = ua[t];
    } else if (navigator.appName == "Netscape" && navigator.appVersion < "5") {
      var z = window.crypto.random(32);
      for (t = 0; t < z.length; ++t) ft[ew++] = z.charCodeAt(t) & 255;
    }
  }
  while (ew < iE) {
    t = Math.floor(65536 * AostarJS.dX.iK.js());
    ft[ew++] = t >>> 8;
    ft[ew++] = t & 255;
  }
  ew = 0;
  ay();
}

function as() {
  if (hj == null) {
    ay();
    hj = aM();
    hj.ej(ft);
    for (ew = 0; ew < ft.length; ++ew) ft[ew] = 0;
    ew = 0;
  }
  return hj.next();
};

function aq(le) {
  var i;
  for (i = 0; i < le.length; ++i) le[i] = as();
};

function ab() {};
ab.prototype.oJ = aq;

function aG() {
  this.i = 0;
  this.j = 0;
  this.S = new Array();
};

function bc(key) {
  var i, j, t;
  for (i = 0; i < 256; ++i) this.S[i] = i;
  j = 0;
  for (i = 0; i < 256; ++i) {
    j = (j + this.S[i] + key[i % key.length]) & 255;
    t = this.S[i];
    this.S[i] = this.S[j];
    this.S[j] = t;
  }
  this.i = 0;
  this.j = 0;
};

function aB() {
  var t;
  this.i = (this.i + 1) & 255;
  this.j = (this.j + this.S[this.i]) & 255;
  t = this.S[this.i];
  this.S[this.i] = this.S[this.j];
  this.S[this.j] = t;
  return this.S[(t + this.S[this.i]) & 255];
};
aG.prototype.ej = bc;
aG.prototype.next = aB;

function aM() {
  return new aG();
};
var iE = 256;
if (typeof py !== 'undefined') {
  py = vL.py = {
    O: O,
    ab: ab
  };
} else {
  this.vn = {
    O: O,
    ab: ab
  };
}

function ag() {
  var r = T();
  this.fT(r);
  return r;
};

function ad() {
  if (this.s < 0) {
    if (this.t == 1) return this[0] - this.eg;
    else if (this.t == 0) return -1;
  } else if (this.t == 1) return this[0];
  else if (this.t == 0) return 0;
  return ((this[1] & ((1 << (32 - this.cu)) - 1)) << this.cu) | this[0];
};

function bP() {
  return (this.t == 0) ? this.s : (this[0] << 24) >> 24;
};

function bV() {
  return (this.t == 0) ? this.s : (this[0] << 16) >> 16;
};

function aK(r) {
  return Math.floor(Math.LN2 * this.cu / Math.log(r));
};

function ao() {
  if (this.s < 0) return -1;
  else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;
  else return 1;
};

function aN(b) {
  if (b == null) b = 10;
  if (this.es() == 0 || b < 2 || b > 36) return "0";
  var gW = this.kc(b);
  var a = Math.pow(b, gW);
  var d = by(a),
    y = T(),
    z = T(),
    r = "";
  this.hI(d, y, z);
  while (y.es() > 0) {
    r = (a + z.hk()).toString(b).substr(1) + r;
    y.hI(d, y, z);
  }
  return z.hk().toString(b) + r;
};

function bC(s, b) {
  this.gH(0);
  if (b == null) b = 10;
  var gW = this.kc(b);
  var d = Math.pow(b, gW),
    iV = false,
    j = 0,
    w = 0;
  for (var i = 0; i < s.length; ++i) {
    var x = aL(s, i);
    if (x < 0) {
      if (s.charAt(i) == "-" && this.es() == 0) iV = true;
      continue;
    }
    w = b * w + x;
    if (++j >= gW) {
      this.ks(d);
      this.hg(w, 0);
      j = 0;
      w = 0;
    }
  }
  if (j > 0) {
    this.ks(Math.pow(b, j));
    this.hg(w, 0);
  }
  if (iV) O.ZERO.fB(this, this);
};

function aA(a, b, c) {
  if ("number" == typeof b) {
    if (a < 2) this.gH(1);
    else {
      this.mK(a, c);
      if (!this.eJ(a - 1)) this.gI(O.ONE.shiftLeft(a - 1), ap, this);
      if (this.fG()) this.hg(1, 0);
      while (!this.qc(b)) {
        this.hg(2, 0);
        if (this.eV() > a) this.fB(O.ONE.shiftLeft(a - 1), this);
      }
    }
  } else {
    var x = new Array(),
      t = a & 7;
    x.length = (a >> 3) + 1;
    b.oJ(x);
    if (t > 0) x[0] &= ((1 << t) - 1);
    else x[0] = 0;
    this.nj(x, 256);
  }
};

function bM() {
  var i = this.t,
    r = new Array();
  r[0] = this.s;
  var p = this.cu - (i * this.cu) % 8,
    d, k = 0;
  if (i-- > 0) {
    if (p < this.cu && (d = this[i] >> p) != (this.s & this.eS) >> p) r[k++] = d | (this.s << (this.cu - p));
    while (i >= 0) {
      if (p < 8) {
        d = (this[i] & ((1 << p) - 1)) << (8 - p);
        d |= this[--i] >> (p += this.cu - 8);
      } else {
        d = (this[i] >> (p -= 8)) & 0xff;
        if (p <= 0) {
          p += this.cu;
          --i;
        }
      }
      if ((d & 0x80) != 0) d |= -256;
      if (k == 0 && (this.s & 0x80) != (d & 0x80)) ++k;
      if (k > 0 || d != this.s) r[k++] = d;
    }
  }
  return r;
};

function au(a) {
  return (this.cS(a) == 0);
};

function aF(a) {
  return (this.cS(a) < 0) ? this : a;
};

function bv(a) {
  return (this.cS(a) > 0) ? this : a;
};

function aI(a, gB, r) {
  var i, f, m = Math.min(a.t, this.t);
  for (i = 0; i < m; ++i) r[i] = gB(this[i], a[i]);
  if (a.t < this.t) {
    f = a.s & this.eS;
    for (i = m; i < this.t; ++i) r[i] = gB(this[i], f);
    r.t = this.t;
  } else {
    f = this.s & this.eS;
    for (i = m; i < a.t; ++i) r[i] = gB(f, a[i]);
    r.t = a.t;
  }
  r.s = gB(this.s, a.s);
  r.eE();
};

function bJ(x, y) {
  return x & y;
};

function bO(a) {
  var r = T();
  this.gI(a, bJ, r);
  return r;
};

function ap(x, y) {
  return x | y;
};

function bz(a) {
  var r = T();
  this.gI(a, ap, r);
  return r;
};

function aS(x, y) {
  return x ^ y;
};

function aD(a) {
  var r = T();
  this.gI(a, aS, r);
  return r;
};

function bQ(x, y) {
  return x & ~y;
};

function bK(a) {
  var r = T();
  this.gI(a, bQ, r);
  return r;
};

function ak() {
  var r = T();
  for (var i = 0; i < this.t; ++i) r[i] = this.eS & ~this[i];
  r.t = this.t;
  r.s = ~this.s;
  return r;
};

function bx(n) {
  var r = T();
  if (n < 0) this.fc(-n, r);
  else this.jB(n, r);
  return r;
};

function be(n) {
  var r = T();
  if (n < 0) this.jB(-n, r);
  else this.fc(n, r);
  return r;
};

function ah(x) {
  if (x == 0) return -1;
  var r = 0;
  if ((x & 0xffff) == 0) {
    x >>= 16;
    r += 16;
  }
  if ((x & 0xff) == 0) {
    x >>= 8;
    r += 8;
  }
  if ((x & 0xf) == 0) {
    x >>= 4;
    r += 4;
  }
  if ((x & 3) == 0) {
    x >>= 2;
    r += 2;
  }
  if ((x & 1) == 0) ++r;
  return r;
};

function bB() {
  for (var i = 0; i < this.t; ++i)
    if (this[i] != 0) return i * this.cu + ah(this[i]);
  if (this.s < 0) return this.t * this.cu;
  return -1;
};

function ai(x) {
  var r = 0;
  while (x != 0) {
    x &= x - 1;
    ++r;
  }
  return r;
};

function aC() {
  var r = 0,
    x = this.s & this.eS;
  for (var i = 0; i < this.t; ++i) r += ai(this[i] ^ x);
  return r;
};

function aO(n) {
  var j = Math.floor(n / this.cu);
  if (j >= this.t) return (this.s != 0);
  return ((this[j] & (1 << (n % this.cu))) != 0);
};

function bU(n, gB) {
  var r = O.ONE.shiftLeft(n);
  this.gI(r, gB, r);
  return r;
};

function bd(n) {
  return this.jg(n, ap);
};

function aQ(n) {
  return this.jg(n, bQ);
};

function bF(n) {
  return this.jg(n, aS);
};

function bj(a, r) {
  var i = 0,
    c = 0,
    m = Math.min(a.t, this.t);
  while (i < m) {
    c += this[i] + a[i];
    r[i++] = c & this.eS;
    c >>= this.cu;
  }
  if (a.t < this.t) {
    c += a.s;
    while (i < this.t) {
      c += this[i];
      r[i++] = c & this.eS;
      c >>= this.cu;
    }
    c += this.s;
  } else {
    c += this.s;
    while (i < a.t) {
      c += a[i];
      r[i++] = c & this.eS;
      c >>= this.cu;
    }
    c += a.s;
  }
  r.s = (c < 0) ? -1 : 0;
  if (c > 0) r[i++] = c;
  else if (c < -1) r[i++] = this.eg + c;
  r.t = i;
  r.eE();
};

function bu(a) {
  var r = T();
  this.gx(a, r);
  return r;
};

function aE(a) {
  var r = T();
  this.fB(a, r);
  return r;
};

function aJ(a) {
  var r = T();
  this.je(a, r);
  return r;
};

function bn() {
  var r = T();
  this.io(r);
  return r;
};

function bN(a) {
  var r = T();
  this.hI(a, r, null);
  return r;
};

function bf(a) {
  var r = T();
  this.hI(a, null, r);
  return r;
};

function bo(a) {
  var q = T(),
    r = T();
  this.hI(a, q, r);
  return new Array(q, r);
};

function av(n) {
  this[this.t] = this.fs(0, n - 1, this, 0, 0, this.t);
  ++this.t;
  this.eE();
};

function bI(n, w) {
  if (n == 0) return;
  while (this.t <= w) this[this.t++] = 0;
  this[w] += n;
  while (this[w] >= this.eg) {
    this[w] -= this.eg;
    if (++w >= this.t) this[this.t++] = 0;
    ++this[w];
  }
};

function bg() {};

function aV(x) {
  return x;
};

function af(x, y, r) {
  x.je(y, r);
};

function aw(x, r) {
  x.io(r);
};
bg.prototype.convert = aV;
bg.prototype.revert = aV;
bg.prototype.gj = af;
bg.prototype.eu = aw;

function aj(e) {
  return this.exp(e, new bg());
};

function aX(a, n, r) {
  var i = Math.min(this.t + a.t, n);
  r.s = 0;
  r.t = i;
  while (i > 0) r[--i] = 0;
  var j;
  for (j = r.t - this.t; i < j; ++i) r[i + this.t] = this.fs(0, a[i], r, i, 0, this.t);
  for (j = Math.min(a.t, n); i < j; ++i) this.fs(0, a[i], r, i, 0, n - i);
  r.eE();
};

function bS(a, n, r) {
  --n;
  var i = r.t = this.t + a.t - n;
  r.s = 0;
  while (--i >= 0) r[i] = 0;
  for (i = Math.max(n - this.t, 0); i < a.t; ++i) r[this.t + i - n] = this.fs(n - i, a[i], r, 0, 0, this.t + i - n);
  r.eE();
  r.kC(1, r);
};

function ar(m) {
  this.r2 = T();
  this.kS = T();
  O.ONE.it(2 * m.t, this.r2);
  this.oV = this.r2.divide(m);
  this.m = m;
};

function aT(x) {
  if (x.s < 0 || x.t > 2 * this.m.t) return x.ez(this.m);
  else if (x.cS(this.m) < 0) return x;
  else {
    var r = T();
    x.fT(r);
    this.reduce(r);
    return r;
  }
};

function aY(x) {
  return x;
};

function bh(x) {
  x.kC(this.m.t - 1, this.r2);
  if (x.t > this.m.t + 1) {
    x.t = this.m.t + 1;
    x.eE();
  }
  this.oV.oW(this.r2, this.m.t + 1, this.kS);
  this.m.oZ(this.kS, this.m.t + 1, this.r2);
  while (x.cS(this.r2) < 0) x.hg(1, this.m.t + 1);
  x.fB(this.r2, x);
  while (x.cS(this.m) >= 0) x.fB(this.m, x);
};

function aH(x, r) {
  x.io(r);
  this.reduce(r);
};

function bk(x, y, r) {
  x.je(y, r);
  this.reduce(r);
};
ar.prototype.convert = aT;
ar.prototype.revert = aY;
ar.prototype.reduce = bh;
ar.prototype.gj = bk;
ar.prototype.eu = aH;

function aa(e, m) {
  var i = e.eV(),
    k, r = by(1),
    z;
  if (i <= 0) return r;
  else if (i < 18) k = 1;
  else if (i < 48) k = 3;
  else if (i < 144) k = 4;
  else if (i < 768) k = 5;
  else k = 6;
  if (i < 8) z = new aZ(m);
  else if (m.fG()) z = new ar(m);
  else z = new aR(m);
  var g = new Array(),
    n = 3,
    ha = k - 1,
    jo = (1 << k) - 1;
  g[1] = z.convert(this);
  if (k > 1) {
    var lv = T();
    z.eu(g[1], lv);
    while (n <= jo) {
      g[n] = T();
      z.gj(lv, g[n - 2], g[n]);
      n += 2;
    }
  }
  var j = e.t - 1,
    w, ke = true,
    r2 = T(),
    t;
  i = aP(e[j]) - 1;
  while (j >= 0) {
    if (i >= ha) w = (e[j] >> (i - ha)) & jo;
    else {
      w = (e[j] & ((1 << (i + 1)) - 1)) << (ha - i);
      if (j > 0) w |= e[j - 1] >> (this.cu + i - ha);
    }
    n = k;
    while ((w & 1) == 0) {
      w >>= 1;
      --n;
    }
    if ((i -= n) < 0) {
      i += this.cu;
      --j;
    }
    if (ke) {
      g[w].fT(r);
      ke = false;
    } else {
      while (n > 1) {
        z.eu(r, r2);
        z.eu(r2, r);
        n -= 2;
      }
      if (n > 0) z.eu(r, r2);
      else {
        t = r;
        r = r2;
        r2 = t;
      }
      z.gj(r2, g[w], r);
    }
    while (j >= 0 && (e[j] & (1 << i)) == 0) {
      z.eu(r, r2);
      t = r;
      r = r2;
      r2 = t;
      if (--i < 0) {
        i = this.cu - 1;
        --j;
      }
    }
  }
  return z.revert(r);
};

function bE(a) {
  var x = (this.s < 0) ? this.gR() : this.clone();
  var y = (a.s < 0) ? a.gR() : a.clone();
  if (x.cS(y) < 0) {
    var t = x;
    x = y;
    y = t;
  }
  var i = x.gv(),
    g = y.gv();
  if (g < 0) return x;
  if (i < g) g = i;
  if (g > 0) {
    x.fc(g, x);
    y.fc(g, y);
  }
  while (x.es() > 0) {
    if ((i = x.gv()) > 0) x.fc(i, x);
    if ((i = y.gv()) > 0) y.fc(i, y);
    if (x.cS(y) >= 0) {
      x.fB(y, x);
      x.fc(1, x);
    } else {
      y.fB(x, y);
      y.fc(1, y);
    }
  }
  if (g > 0) y.jB(g, y);
  return y;
};

function bA(n) {
  if (n <= 0) return 0;
  var d = this.eg % n,
    r = (this.s < 0) ? n - 1 : 0;
  if (this.t > 0)
    if (d == 0) r = this[0] % n;
    else
      for (var i = this.t - 1; i >= 0; --i) r = (d * r + this[i]) % n;
  return r;
};

function bG(m) {
  var hb = m.fG();
  if ((this.fG() && hb) || m.es() == 0) return O.ZERO;
  var u = m.clone(),
    v = this.clone();
  var a = by(1),
    b = by(0),
    c = by(0),
    d = by(1);
  while (u.es() != 0) {
    while (u.fG()) {
      u.fc(1, u);
      if (hb) {
        if (!a.fG() || !b.fG()) {
          a.gx(this, a);
          b.fB(m, b);
        }
        a.fc(1, a);
      } else if (!b.fG()) b.fB(m, b);
      b.fc(1, b);
    }
    while (v.fG()) {
      v.fc(1, v);
      if (hb) {
        if (!c.fG() || !d.fG()) {
          c.gx(this, c);
          d.fB(m, d);
        }
        c.fc(1, c);
      } else if (!d.fG()) d.fB(m, d);
      d.fc(1, d);
    }
    if (u.cS(v) >= 0) {
      u.fB(v, u);
      if (hb) a.fB(c, a);
      b.fB(d, b);
    } else {
      v.fB(u, v);
      if (hb) c.fB(a, c);
      d.fB(b, d);
    }
  }
  if (v.cS(O.ONE) != 0) return O.ZERO;
  if (d.cS(m) >= 0) return d.eZ(m);
  if (d.es() < 0) d.gx(m, d);
  else return d;
  if (d.es() < 0) return d.add(m);
  else return d;
};
var ee = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997];
var lO = (1 << 26) / ee[ee.length - 1];

function bq(t) {
  var i, x = this.abs();
  if (x.t == 1 && x[0] <= ee[ee.length - 1]) {
    for (i = 0; i < ee.length; ++i)
      if (x[0] == ee[i]) return true;
    return false;
  }
  if (x.fG()) return false;
  i = 1;
  while (i < ee.length) {
    var m = ee[i],
      j = i + 1;
    while (j < ee.length && m < lO) m *= ee[j++];
    m = x.nI(m);
    while (i < j)
      if (m % ee[i++] == 0) return false;
  }
  return x.ou(t);
};

function az(t) {
  var ho = this.eZ(O.ONE);
  var k = ho.gv();
  if (k <= 0) return false;
  var r = ho.kF(k);
  t = (t + 1) >> 1;
  if (t > ee.length) t = ee.length;
  var a = T();
  for (var i = 0; i < t; ++i) {
    a.gH(ee[Math.floor(AostarJS.dX.iK.js() * ee.length)]);
    var y = a.oi(r, this);
    if (y.cS(O.ONE) != 0 && y.cS(ho) != 0) {
      var j = 1;
      while (j++ < k && y.cS(ho) != 0) {
        y = y.rX(2, this);
        if (y.cS(O.ONE) == 0) return false;
      }
      if (y.cS(ho) != 0) return false;
    }
  }
  return true;
};
O.prototype.kc = aK;
O.prototype.fD = aN;
O.prototype.qX = bC;
O.prototype.mK = aA;
O.prototype.gI = aI;
O.prototype.jg = bU;
O.prototype.gx = bj;
O.prototype.ks = av;
O.prototype.hg = bI;
O.prototype.oZ = aX;
O.prototype.oW = bS;
O.prototype.nI = bA;
O.prototype.ou = az;
O.prototype.clone = ag;
O.prototype.hk = ad;
O.prototype.tf = bP;
O.prototype.vJ = bV;
O.prototype.es = ao;
O.prototype.uz = bM;
O.prototype.el = au;
O.prototype.min = aF;
O.prototype.max = bv;
O.prototype.and = bO;
O.prototype.fq = bz;
O.prototype.xor = aD;
O.prototype.tk = bK;
O.prototype.not = ak;
O.prototype.shiftLeft = bx;
O.prototype.kF = be;
O.prototype.gv = bB;
O.prototype.vc = aC;
O.prototype.eJ = aO;
O.prototype.vA = bd;
O.prototype.uM = aQ;
O.prototype.wL = bF;
O.prototype.add = bu;
O.prototype.eZ = aE;
O.prototype.multiply = aJ;
O.prototype.divide = bN;
O.prototype.vi = bf;
O.prototype.xb = bo;
O.prototype.oi = aa;
O.prototype.ij = bG;
O.prototype.pow = aj;
O.prototype.wI = bE;
O.prototype.qc = bq;
O.prototype.square = bn;

function aG() {
  this.i = 0;
  this.j = 0;
  this.S = new Array();
};

function bc(key) {
  var i, j, t;
  for (i = 0; i < 256; ++i) this.S[i] = i;
  j = 0;
  for (i = 0; i < 256; ++i) {
    j = (j + this.S[i] + key[i % key.length]) & 255;
    t = this.S[i];
    this.S[i] = this.S[j];
    this.S[j] = t;
  }
  this.i = 0;
  this.j = 0;
};

function aB() {
  var t;
  this.i = (this.i + 1) & 255;
  this.j = (this.j + this.S[this.i]) & 255;
  t = this.S[this.i];
  this.S[this.i] = this.S[this.j];
  this.S[this.j] = t;
  return this.S[(t + this.S[this.i]) & 255];
};
aG.prototype.ej = bc;
aG.prototype.next = aB;

function aM() {
  return new aG();
};
var iE = 256;
var hj;
var ft;
var ew;

function aU(x) {
  ft[ew++] ^= x & 255;
  ft[ew++] ^= (x >> 8) & 255;
  ft[ew++] ^= (x >> 16) & 255;
  ft[ew++] ^= (x >> 24) & 255;
  if (ew >= iE) ew -= iE;
};

function ay() {
  aU(new Date().getTime());
};
if (ft == null) {
  ft = new Array();
  ew = 0;
  var t;
  if (window.crypto && window.crypto.oe) {
    var ua = new Uint8Array(32);
    window.crypto.oe(ua);
    for (t = 0; t < 32; ++t) ft[ew++] = ua[t];
  }
  if (navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto) {
    var z = window.crypto.random(32);
    for (t = 0; t < z.length; ++t) ft[ew++] = z.charCodeAt(t) & 255;
  }
  while (ew < iE) {
    t = Math.floor(65536 * AostarJS.dX.iK.js());
    ft[ew++] = t >>> 8;
    ft[ew++] = t & 255;
  }
  ew = 0;
  ay();
}

function as() {
  if (hj == null) {
    ay();
    hj = aM();
    hj.ej(ft);
    for (ew = 0; ew < ft.length; ++ew) ft[ew] = 0;
    ew = 0;
  }
  return hj.next();
};

function aq(le) {
  var i;
  for (i = 0; i < le.length; ++i) le[i] = as();
};

function ab() {};
ab.prototype.oJ = aq;
if (typeof Aostar == "undefined" || !Aostar) var Aostar = {};
if (typeof Aostar.crypto == "undefined" || !Aostar.crypto) Aostar.crypto = {};
Aostar.crypto.hl = new function () {
  this.nz = {
    'iB': "3021300906052b0e03021a05000414",
    'sha224': "302d300d06096086480165030402040500041c",
    'hC': "3031300d060960864801650304020105000420",
    'sha384': "3041300d060960864801650304020205000430",
    'iZ': "3051300d060960864801650304020305000440",
    'md2': "3020300c06082a864886f70d020205000410",
    'jc': "3020300c06082a864886f70d020505000410",
    'iJ': "3021300906052b2403020105000414"
  };
  this.kb = {
    'jc': 'cryptojs',
    'iB': 'cryptojs',
    'sha224': 'cryptojs',
    'hC': 'cryptojs',
    'sha384': 'cryptojs',
    'iZ': 'cryptojs',
    'iJ': 'cryptojs',
    'hmacmd5': 'cryptojs',
    'hmacsha1': 'cryptojs',
    'hmacsha224': 'cryptojs',
    'hmacsha256': 'cryptojs',
    'hmacsha384': 'cryptojs',
    'hmacsha512': 'cryptojs',
    'hmacripemd160': 'cryptojs',
    'sm3': 'cryptojs',
    'MD5withRSA': 'cryptojs/jsrsa',
    'SHA1withRSA': 'cryptojs/jsrsa',
    'SHA224withRSA': 'cryptojs/jsrsa',
    'SHA256withRSA': 'cryptojs/jsrsa',
    'SHA384withRSA': 'cryptojs/jsrsa',
    'SHA512withRSA': 'cryptojs/jsrsa',
    'RIPEMD160withRSA': 'cryptojs/jsrsa',
    'MD5withECDSA': 'cryptojs/jsrsa',
    'SHA1withECDSA': 'cryptojs/jsrsa',
    'SHA224withECDSA': 'cryptojs/jsrsa',
    'SHA256withECDSA': 'cryptojs/jsrsa',
    'SHA384withECDSA': 'cryptojs/jsrsa',
    'SHA512withECDSA': 'cryptojs/jsrsa',
    'RIPEMD160withECDSA': 'cryptojs/jsrsa',
    'SHA1withDSA': 'cryptojs/jsrsa',
    'SHA224withDSA': 'cryptojs/jsrsa',
    'SHA256withDSA': 'cryptojs/jsrsa',
    'MD5withRSAandMGF1': 'cryptojs/jsrsa',
    'SHA1withRSAandMGF1': 'cryptojs/jsrsa',
    'SHA224withRSAandMGF1': 'cryptojs/jsrsa',
    'SHA256withRSAandMGF1': 'cryptojs/jsrsa',
    'SHA384withRSAandMGF1': 'cryptojs/jsrsa',
    'SHA512withRSAandMGF1': 'cryptojs/jsrsa',
    'RIPEMD160withRSAandMGF1': 'cryptojs/jsrsa'
  };
  this.pD = {
    'jc': 'AostarJS.gV.MD5',
    'iB': 'AostarJS.gV.SHA1',
    'sha224': 'AostarJS.gV.SHA224',
    'hC': 'AostarJS.gV.SHA256',
    'sha384': 'AostarJS.gV.SHA384',
    'iZ': 'AostarJS.gV.SHA512',
    'iJ': 'AostarJS.gV.RIPEMD160',
    'sm3': 'AostarJS.gV.kE'
  };
  this.vf = function (oT, cE) {
    if (typeof this.nz[cE] == "undefined") throw "cE not supported in hl.nz: " + cE;
    return this.nz[cE] + oT;
  };
  this.yU = function (oT, cE, hB) {
    var nG = this.vf(oT, cE);
    var pu = hB / 4;
    if (nG.length + 22 > pu) throw "key is too short for SigAlg: hM=" + hB + "," + cE;
    var rK = "0001";
    var sb = "00" + nG;
    var tj = "";
    var vE = pu - rK.length - sb.length;
    for (var i = 0; i < vE; i += 2) {
      tj += "ff";
    }
    var ur = rK + tj + sb;
    return ur;
  };
  this.xm = function (s, cE) {
    var ey = new Aostar.crypto.gT({
      'cE': cE
    });
    return ey.ht(s);
  };
  this.fl = function (we, cE) {
    var ey = new Aostar.crypto.gT({
      'cE': cE
    });
    return ey.jE(we);
  };
  this.iB = function (s) {
    var ey = new Aostar.crypto.gT({
      'cE': 'iB',
      'dh': 'cryptojs'
    });
    return ey.ht(s);
  };
  this.hC = function (s) {
    var ey = new Aostar.crypto.gT({
      'cE': 'hC',
      'dh': 'cryptojs'
    });
    return ey.ht(s);
  };
  this.yW = function (s) {
    var ey = new Aostar.crypto.gT({
      'cE': 'hC',
      'dh': 'cryptojs'
    });
    return ey.jE(s);
  };
  this.iZ = function (s) {
    var ey = new Aostar.crypto.gT({
      'cE': 'iZ',
      'dh': 'cryptojs'
    });
    return ey.ht(s);
  };
  this.xQ = function (s) {
    var ey = new Aostar.crypto.gT({
      'cE': 'iZ',
      'dh': 'cryptojs'
    });
    return ey.jE(s);
  };
  this.jc = function (s) {
    var ey = new Aostar.crypto.gT({
      'cE': 'jc',
      'dh': 'cryptojs'
    });
    return ey.ht(s);
  };
  this.iJ = function (s) {
    var ey = new Aostar.crypto.gT({
      'cE': 'iJ',
      'dh': 'cryptojs'
    });
    return ey.ht(s);
  };
  this.wc = function (s) {};
};
Aostar.crypto.gT = function (dk) {
  var ey = null;
  var eC = null;
  var eW = null;
  this.gc = function (cE, dh) {
    if (cE != null && dh === undefined) dh = Aostar.crypto.hl.kb[cE];
    if (':jc:iB:sha224:hC:sha384:iZ:iJ:sm3:'.indexOf(cE) != -1 && dh == 'cryptojs') {
      try {
        this.ey = eval(Aostar.crypto.hl.pD[cE]).create();
      } catch (ex) {
        throw "gc hash cE set fail cE=" + cE + "/" + ex;
      }
      this.eb = function (fb) {
        this.ey.update(fb);
      };
      this.eQ = function (cf) {
        var mj = AostarJS.dX.gJ.parse(cf);
        this.ey.update(mj);
      };
      this.hs = function () {
        var hash = this.ey.hU();
        return hash.toString(AostarJS.dX.gJ);
      };
      this.ht = function (fb) {
        this.eb(fb);
        return this.hs();
      };
      this.jE = function (cf) {
        this.eQ(cf);
        return this.hs();
      };
    }
    if (':hC:'.indexOf(cE) != -1 && dh == 'nR') {
      try {
        this.ey = new nR.hash.hC();
      } catch (ex) {
        throw "gc hash cE set fail cE=" + cE + "/" + ex;
      }
      this.eb = function (fb) {
        this.ey.update(fb);
      };
      this.eQ = function (cf) {
        var uk = nR.tC.cf.xr(cf);
        this.ey.update(uk);
      };
      this.hs = function () {
        var hash = this.ey.hU();
        return nR.tC.cf.vq(hash);
      };
      this.ht = function (fb) {
        this.eb(fb);
        return this.hs();
      };
      this.jE = function (cf) {
        this.eQ(cf);
        return this.hs();
      };
    }
  };
  this.eb = function (fb) {
    throw "eb(fb) not supported for this cE/dh: " + this.eC + "/" + this.eW;
  };
  this.eQ = function (cf) {
    throw "eQ(cf) not supported for this cE/dh: " + this.eC + "/" + this.eW;
  };
  this.hs = function () {
    throw "hs() not supported for this cE/dh: " + this.eC + "/" + this.eW;
  };
  this.ht = function (fb) {
    throw "ht(fb) not supported for this cE/dh: " + this.eC + "/" + this.eW;
  };
  this.jE = function (cf) {
    throw "jE(cf) not supported for this cE/dh: " + this.eC + "/" + this.eW;
  };
  if (dk !== undefined) {
    if (dk['cE'] !== undefined) {
      this.eC = dk['cE'];
      if (dk['dh'] === undefined) this.eW = Aostar.crypto.hl.kb[this.eC];
      this.gc(this.eC, this.eW);
    }
  }
};
Aostar.crypto.vS = function (dk) {
  var lU = null;
  var iH = null;
  var eC = null;
  var eW = null;
  var lj = null;
  this.gc = function (cE, dh) {
    if (cE == null) cE = "hmacsha1";
    cE = cE.toLowerCase();
    if (cE.substr(0, 4) != "hmac") {
      throw "gc unsupported qs cE: " + cE;
    }
    if (dh === undefined) dh = Aostar.crypto.hl.kb[cE];
    this.lj = cE + "/" + dh;
    var lE = cE.substr(4);
    if (':jc:iB:sha224:hC:sha384:iZ:iJ:'.indexOf(lE) != -1 && dh == 'cryptojs') {
      try {
        var vs = eval(Aostar.crypto.hl.pD[lE]);
        this.lU = AostarJS.gV.qs.create(vs, this.iH);
      } catch (ex) {
        throw "gc hash cE set fail lE=" + lE + "/" + ex;
      }
      this.eb = function (fb) {
        this.lU.update(fb);
      };
      this.eQ = function (cf) {
        var mj = AostarJS.dX.gJ.parse(cf);
        this.lU.update(mj);
      };
      this.oq = function () {
        var hash = this.lU.hU();
        return hash.toString(AostarJS.dX.gJ);
      };
      this.wF = function (fb) {
        this.eb(fb);
        return this.oq();
      };
      this.vU = function (cf) {
        this.eQ(cf);
        return this.oq();
      };
    }
  };
  this.eb = function (fb) {
    throw "eb(fb) not supported for this cE/dh: " + this.lj;
  };
  this.eQ = function (cf) {
    throw "eQ(cf) not supported for this cE/dh: " + this.lj;
  };
  this.oq = function () {
    throw "hs() not supported for this cE/dh: " + this.lj;
  };
  this.wF = function (fb) {
    throw "ht(fb) not supported for this cE/dh: " + this.lj;
  };
  this.vU = function (cf) {
    throw "jE(cf) not supported for this cE/dh: " + this.lj;
  };
  if (dk !== undefined) {
    if (dk['iH'] !== undefined) {
      this.iH = dk['iH'];
    }
    if (dk['cE'] !== undefined) {
      this.eC = dk['cE'];
      if (dk['dh'] === undefined) this.eW = Aostar.crypto.hl.kb[this.eC];
      this.gc(this.eC, this.eW);
    }
  }
};
Aostar.crypto.gL = function (dk) {
  var fS = null;
  var eI = null;
  var ey = null;
  var ca = null;
  var eC = null;
  var eW = null;
  var gw = null;
  var jn = null;
  var hZ = null;
  var state = null;
  var mg = -1;
  var vg = null;
  var en = null;
  var nG = null;
  var xJ = null;
  var iF = null;
  this.sU = function () {
    if (this.eC.match(/^(.+)with(.+)$/)) {
      this.jn = RegExp.$1.toLowerCase();
      this.hZ = RegExp.$2.toLowerCase();
    }
  };
  this.wC = function (cf, eV) {
    var s = "";
    var vt = eV / 4 - cf.length;
    for (var i = 0; i < vt; i++) {
      s = s + "0";
    }
    return s + cf;
  };
  this.gc = function (cE, dh) {
    this.sU();
    if (dh != 'cryptojs/jsrsa') throw "provider not supported: " + dh;
    if (':jc:iB:sha224:hC:sha384:iZ:iJ:sm3:'.indexOf(this.jn) != -1) {
      try {
        this.ey = new Aostar.crypto.gT({
          'cE': this.jn
        });
      } catch (ex) {
        throw "gc hash cE set fail cE=" + this.jn + "/" + ex;
      }
      this.ej = function (qP, iH) {
        var iI = null;
        try {
          if (iH === undefined) {
            iI = vC.uu(qP);
          } else {
            iI = vC.uu(qP, iH);
          }
        } catch (ex) {
          throw "ej failed:" + ex;
        }
        if (iI.qK === true) {
          this.fS = iI;
          this.state = "SIGN";
        } else if (iI.qk === true) {
          this.eI = iI;
          this.state = "VERIFY";
        } else {
          throw "ej failed.:" + iI;
        }
      };
      this.jI = function (dk) {
        if (typeof dk['ecprvhex'] == 'string' && typeof dk['eY'] == 'string') {
          this.ecprvhex = dk['ecprvhex'];
          this.eY = dk['eY'];
        } else {
          this.fS = dk;
        }
        this.state = "SIGN";
        if (dk['hy'] !== undefined && typeof dk['hy'] == 'string') {
          this.hy = dk['hy'];
        } else {
          this.hy = "1234567812345678";
        }
      };
      this.lx = function (dk) {
        if (typeof dk['ecpubhex'] == 'string' && typeof dk['eY'] == 'string') {
          this.ecpubhex = dk['ecpubhex'];
          this.eY = dk['eY'];
        } else if (dk instanceof Aostar.crypto.fH) {
          this.eI = dk;
        } else if (dk instanceof vV) {
          this.eI = dk;
        }
        this.state = "VERIFY";
        if (dk['hy'] !== undefined && typeof dk['hy'] == 'string') {
          this.hy = dk['hy'];
        } else {
          this.hy = "1234567812345678";
        }
      };
      this.rR = function (nY) {
        var jv = new vp();
        jv.wp(nY);
        this.eI = jv.ws;
        this.state = "VERIFY";
      };
      this.eb = function (fb) {
        this.ey.eb(fb);
      };
      this.eQ = function (cf) {
        this.ey.eQ(cf);
      };
      this.gq = function () {
        if (this.eY != "sm2") {
          this.en = this.ey.hs();
        }
        if (typeof this.ecprvhex != "undefined" && typeof this.eY != "undefined") {
          if (this.eY == "sm2") {
            var eH = new Aostar.crypto.SM3withSM2({
              cj: this.eY
            });
            var G = eH.fC['G'];
            var Q = G.multiply(new O(this.ecprvhex, 16));
            var cY = Q.fv().dG().fD(16) + Q.fw().dG().fD(16);
            var fJ = new bD();
            var z = new bD().qJ(G, cY, this.hy);
            var lg = fJ.jX(fJ.fF(z).toString());
            var hc = AostarJS.dX.eN.stringify(this.ey.ey.hG);
            hc = AostarJS.dX.eN.parse(hc).toString();
            hc = fJ.dV(hc);
            var jK = new Array(fJ.oM());
            fJ.fh(lg, 0, lg.length);
            fJ.fh(hc, 0, hc.length);
            fJ.iS(jK, 0);
            var fl = fJ.fF(jK).toString();
            this.en = fl;
            this.iF = eH.iw(this.en, this.ecprvhex);
          } else {
            var eH = new Aostar.crypto.fH({
              'cj': this.eY
            });
            this.iF = eH.iw(this.en, this.ecprvhex);
          }
        } else if (this.hZ == "rsaandmgf1") {
          this.iF = this.fS.vr(this.en, this.jn, this.mg);
        } else if (this.hZ == "rsa") {
          this.iF = this.fS.mZ(this.en, this.jn);
        } else if (this.fS instanceof Aostar.crypto.fH) {
          this.iF = this.fS.mZ(this.en);
        } else if (this.fS instanceof Aostar.crypto.xa) {
          this.iF = this.fS.mZ(this.en);
        } else {
          throw "gL: unsupported public key cE: " + this.hZ;
        }
        return this.iF;
      };
      this.wt = function (fb) {
        this.eb(fb);
        this.gq();
      };
      this.iw = function (cf) {
        this.eQ(cf);
        this.gq();
      };
      this.iP = function (iW) {
        if (this.eY != "sm2") {
          this.en = this.ey.hs();
        }
        if (typeof this.ecpubhex != "undefined" && typeof this.eY != "undefined") {
          if (this.eY == "sm2") {
            var eH = new Aostar.crypto.SM3withSM2({
              cj: this.eY
            });
            var G = eH.fC['G'];
            var cY = this.ecpubhex.substr(2, 128);
            var fJ = new bD();
            var z = new bD().qJ(G, cY, this.hy);
            var lg = fJ.jX(fJ.fF(z).toString());
            var hc = AostarJS.dX.eN.stringify(this.ey.ey.hG);
            hc = AostarJS.dX.eN.parse(hc).toString();
            hc = fJ.dV(hc);
            var jK = new Array(fJ.oM());
            fJ.fh(lg, 0, lg.length);
            fJ.fh(hc, 0, hc.length);
            fJ.iS(jK, 0);
            var fl = fJ.fF(jK).toString();
            this.en = fl;
            return eH.kU(this.en, iW, this.ecpubhex);
          } else {
            var eH = new Aostar.crypto.fH({
              cj: this.eY
            });
            return eH.kU(this.en, iW, this.ecpubhex);
          }
        } else if (this.hZ == "rsaandmgf1") {
          return this.eI.wm(this.en, iW, this.jn, this.mg);
        } else if (this.hZ == "rsa") {
          return this.eI.mt(this.en, iW);
        } else if (this.eI instanceof Aostar.crypto.fH) {
          return this.eI.mt(this.en, iW);
        } else if (this.eI instanceof Aostar.crypto.xa) {
          return this.eI.mt(this.en, iW);
        } else {
          throw "gL: unsupported public key cE: " + this.hZ;
        }
      };
    }
  };
  this.ej = function (key, iH) {
    throw "ej(key, iH) not supported for this cE:dh=" + this.gw;
  };
  this.lx = function (yA) {
    throw "lx(rsaPubKeyy) not supported for this cE:dh=" + this.gw;
  };
  this.rR = function (nY) {
    throw "rR(nY) not supported for this cE:dh=" + this.gw;
  };
  this.jI = function (fS) {
    throw "jI(fS) not supported for this cE:dh=" + this.gw;
  };
  this.eb = function (fb) {
    throw "eb(fb) not supported for this cE:dh=" + this.gw;
  };
  this.eQ = function (cf) {
    throw "eQ(cf) not supported for this cE:dh=" + this.gw;
  };
  this.gq = function () {
    throw "gq() not supported for this cE:dh=" + this.gw;
  };
  this.wt = function (fb) {
    throw "ht(fb) not supported for this cE:dh=" + this.gw;
  };
  this.iw = function (cf) {
    throw "jE(cf) not supported for this cE:dh=" + this.gw;
  };
  this.iP = function (iW) {
    throw "iP(iW) not supported for this cE:dh=" + this.gw;
  };
  this.vg = dk;
  if (dk !== undefined) {
    if (dk['cE'] !== undefined) {
      this.eC = dk['cE'];
      if (dk['dh'] === undefined) {
        this.eW = Aostar.crypto.hl.kb[this.eC];
      } else {
        this.eW = dk['dh'];
      }
      this.gw = this.eC + ":" + this.eW;
      this.gc(this.eC, this.eW);
      this.sU();
    }
    if (dk['psssaltlen'] !== undefined) this.mg = dk['psssaltlen'];
    if (dk['prvkeypem'] !== undefined) {
      if (dk['prvkeypas'] !== undefined) {
        throw "both prvkeypem and prvkeypas parameters not supported";
      } else {
        try {
          var fS = new vV();
          fS.vP(dk['prvkeypem']);
          this.jI(fS);
        } catch (ex) {
          throw "fatal error to load pem private key: " + ex;
        }
      }
    }
  }
};
Aostar.crypto.jP = new function () {
  this.xg = {
    '2a864886f70d010101': 'rsaEncryption',
    '2a8648ce3d0201': 'ecPublicKey',
    '2a8648ce380401': 'dsa',
    '2a8648ce3d030107': 'secp256r1',
    '2b8104001f': 'secp192k1',
    '2b81040021': 'secp224r1',
    '2b8104000a': 'secp256k1',
    '2b81040023': 'secp521r1',
    '2b81040022': 'secp384r1',
    '2a8648ce380403': 'SHA1withDSA',
    '608648016503040301': 'SHA224withDSA',
    '608648016503040302': 'SHA256withDSA'
  };
};
if (typeof Aostar == "undefined" || !Aostar) var Aostar = {};
if (typeof Aostar.crypto == "undefined" || !Aostar.crypto) Aostar.crypto = {};
Aostar.crypto.hu = new function () {
  var gY = {};
  var nH = {};

  function ae(cf) {
    return new O(cf, 16);
  };
  this.getByName = function (rN) {
    var name = rN;
    if (typeof nH[name] != "undefined") {
      name = nH[rN];
    }
    if (typeof gY[name] != "undefined") {
      return gY[name];
    }
    throw "unregistered EC cj name: " + name;
  };
  this.gP = function (name, hM, vX, rG, us, ut, wi, uW, tF, sF, gg, rJ) {
    gY[name] = {};
    var p = ae(vX);
    var a = ae(rG);
    var b = ae(us);
    var n = ae(ut);
    var h = ae(wi);
    var cj = new bw(p, a, b);
    var G = cj.rI("04" + uW + tF);
    gY[name]['name'] = name;
    gY[name]['hM'] = hM;
    gY[name]['cj'] = cj;
    gY[name]['G'] = G;
    gY[name]['n'] = n;
    gY[name]['h'] = h;
    gY[name]['gg'] = gg;
    gY[name]['rJ'] = rJ;
    for (var i = 0; i < sF.length; i++) {
      nH[sF[i]] = name;
    }
  };
};
Aostar.crypto.hu.gP("secp128r1", 128, "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC", "E87579C11079F43DD824993C2CEE5ED3", "FFFFFFFE0000000075A30D1B9038A115", "1", "161FF7528B899B2D0C28607CA52C5B86", "CF5AC8395BAFEB13C02DA292DDED7A83", [], "", "secp128r1 : SECG cj over a 128 bit prime field");
Aostar.crypto.hu.gP("secp160k1", 160, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73", "0", "7", "0100000000000000000001B8FA16DFAB9ACA16B6B3", "1", "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB", "938CF935318FDCED6BC28286531733C3F03C4FEE", [], "", "secp160k1 : SECG cj over a 160 bit prime field");
Aostar.crypto.hu.gP("secp160r1", 160, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC", "1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45", "0100000000000000000001F4C8F927AED3CA752257", "1", "4A96B5688EF573284664698968C38BB913CBFC82", "23A628553168947D59DCC912042351377AC5FB32", [], "", "secp160r1 : SECG cj over a 160 bit prime field");
Aostar.crypto.hu.gP("secp192k1", 192, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37", "0", "3", "FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D", "1", "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D", "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D", []);
Aostar.crypto.hu.gP("secp192r1", 192, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", "64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1", "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831", "1", "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012", "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811", []);
Aostar.crypto.hu.gP("secp224r1", 224, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE", "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4", "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D", "1", "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21", "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34", []);
Aostar.crypto.hu.gP("secp256k1", 256, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", "0", "7", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", "1", "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798", "483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8", []);
Aostar.crypto.hu.gP("secp256r1", 256, "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF", "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC", "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B", "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551", "1", "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296", "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5", ["NIST P-256", "P-256", "prime256v1"]);
Aostar.crypto.hu.gP("secp384r1", 384, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC", "B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973", "1", "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7", "3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f", ["NIST P-384", "P-384"]);
Aostar.crypto.hu.gP("secp521r1", 521, "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC", "051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00", "1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409", "1", "C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66", "011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650", ["NIST P-521", "P-521"]);
Aostar.crypto.hu.gP("sm2", 256, "FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF", "FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC", "28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93", "FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123", "1", "32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7", "BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0", ["sm2", "SM2"]);

function bp(eT, gX) {
  this.jV = 1;
  this.kY = null;
  this.lG = null;
  this.ip = null;
  this.gX = null;
  this.key = new Array(32);
  this.jU = 0;
  if (typeof (eT) != 'undefined') {
    this.eT = eT;
  } else {
    this.eT = CipherMode.C1C3C2;
  }
  if (typeof (gX) != 'undefined') {
    this.gX = gX;
  } else {
    this.gX = null;
  }
};
bp.prototype = {
  mc: function (h) {
    if ((h.length & 1) == 0) {
      return h;
    } else {
      return "0" + h;
    }
  },
  xL: function (n) {
    if (n > 127 || n < -128) {
      var result = 0xff & n;
      if (result > 127) {
        result = 0x7f & n;
        result = 0x7f ^ result;
        return -(result + 1);
      }
      return result;
    } else {
      return n;
    }
  },
  Reset: function () {
    this.lG = new bD();
    this.ip = new bD();
    var mb = this.jX(this.kY.fv().dG().fD(16));
    var ln = this.jX(this.kY.fw().dG().fD(16));
    this.ip.fh(mb, 0, mb.length);
    this.lG.fh(mb, 0, mb.length);
    this.lG.fh(ln, 0, ln.length);
    this.jV = 1;
    this.nN();
  },
  nN: function () {
    var kW = new bD(this.lG);
    kW.fQ(this.jV >> 24 & 0xff);
    kW.fQ(this.jV >> 16 & 0xff);
    kW.fQ(this.jV >> 8 & 0xff);
    kW.fQ(this.jV & 0xff);
    kW.iS(this.key, 0);
    this.jU = 0;
    this.jV++;
  },
  sQ: function (hF) {
    var k = null;
    var eK = null;
    var eH = new Aostar.crypto.fH({
      "cj": "sm2"
    });
    var kZ = (this.gX == null ? eH.generateKeyPairHex() : eH.tM(this.gX));
    k = new O(kZ.ecprvhex, 16);
    var he = kZ.ecpubhex;
    eK = K.kn(eH.fC['cj'], he);
    this.kY = hF.multiply(k);
    this.Reset();
    return eK;
  },
  generateKeyPairHex: function (eH) {
    var eH = new Aostar.crypto.fH({
      "cj": "sm2"
    });
    return eH.generateKeyPairHex();
  },
  vx: function (ecpubhex) {
    var iq = ecpubhex.length - 2;
    var rQ = ecpubhex.substr(2, 2);
    var sZ = ecpubhex.substr(2 + iq / 2, 2);
    if (rQ === '00' || sZ === '00') {
      return false;
    } else {
      return true;
    }
  },
  pF: function (data) {
    this.ip.fh(data, 0, data.length);
    for (var i = 0; i < data.length; i++) {
      if (this.jU == this.key.length) {
        this.nN();
      }
      data[i] ^= this.key[this.jU++];
    }
  },
  sM: function (lN, eK) {
    this.kY = eK.multiply(lN);
    this.Reset();
  },
  qw: function (data) {
    for (var i = 0; i < data.length; i++) {
      if (this.jU == this.key.length) {
        this.nN();
      }
      data[i] ^= this.key[this.jU++];
    }
    this.ip.fh(data, 0, data.length);
  },
  nu: function (fN) {
    var ln = this.jX(this.kY.fw().dG().fD(16));
    this.ip.fh(ln, 0, ln.length);
    this.ip.iS(fN, 0);
    this.Reset();
  },
  nS: function (eI, plaintext) {
    var data = new Array(plaintext.length);
    Array.Copy(plaintext, 0, data, 0, plaintext.length);
    var eK = this.sQ(eI);
    this.pF(data);
    var fN = new Array(32);
    this.nu(fN);
    var fX;
    if (this.eT == CipherMode.C1C3C2) {
      fX = this.mc(eK.fv().dG().fD(16)) + this.mc(eK.fw().dG().fD(16)) + this.fF(fN).toString() + this.fF(data).toString();
    } else if (this.eT == CipherMode.C1C2C3) {
      fX = this.mc(eK.fv().dG().fD(16)) + this.mc(eK.fw().dG().fD(16)) + this.fF(data).toString() + this.fF(fN).toString();
    } else {
      throw new Error("[SM2:kf]invalid type eT(" + this.eT + ")");
    }
    return "04" + fX;
  },
  nb: function (eI, plaintext) {
    var data = new Array(plaintext.length);
    Array.Copy(plaintext, 0, data, 0, plaintext.length);
    var eK = this.sQ(eI);
    this.pF(data);
    var fN = new Array(32);
    this.nu(fN);
    var x = new Aostar.dF.gu({
      kA: eK.fv().dG()
    });
    var y = new Aostar.dF.gu({
      kA: eK.fw().dG()
    });
    var qI = new Aostar.dF.jH({
      cf: this.fF(fN).toString()
    });
    var pU = new Aostar.dF.jH({
      cf: this.fF(data).toString()
    });
    var options;
    if (this.eT == CipherMode.C1C3C2) {
      options = {
        array: [x, y, qI, pU]
      };
    } else if (this.eT == CipherMode.C1C2C3) {
      options = {
        array: [x, y, pU, qI]
      };
    } else {
      throw new Error("[SM2:nb]invalid type eT(" + this.eT + ")");
    }
    var ny = new Aostar.dF.iU(options);
    return ny.hn();
  },
  dV: function (fu) {
    var cA = [];
    var fR = fu.length;
    for (var i = 0; i < fR; i += 2) {
      cA[cA.length] = parseInt(fu.substr(i, 2), 16);
    }
    return cA;
  },
  jX: function (fu) {
    var cA = [];
    if (fu.length < 64) {
      fu = this.kX(fu, 64);
    }
    if (fu.length > 64) {
      fu = fu.substr(fu.length - 64, fu.length);
    }
    var fR = fu.length;
    for (var i = 0; i < fR; i += 2) {
      cA[cA.length] = parseInt(fu.substr(i, 2), 16);
    }
    return cA;
  },
  kX: function (fu, length) {
    return new Array((length + 1) - fu.length).join("0") + fu;
  },
  fF: function (gz) {
    var cA = new Array(32);
    var j = 0;
    for (var i = 0; i < gz.length * 2; i += 2) {
      cA[i >>> 3] |= parseInt(gz[j]) << (24 - (i % 8) * 4);
      j++;
    }
    var ep = new AostarJS.jh.et.ej(cA, gz.length);
    return ep;
  },
  kf: function (mr, fm) {
    var fX = fm.substr(0, 2) === "04" ? fm.substr(2) : fm;
    var hK = fX.substr(0, 64);
    var jb = fX.substr(0 + hK.length, 64);
    var fN;
    var oh;
    if (this.eT == CipherMode.C1C3C2) {
      fN = fX.substr(hK.length + jb.length, 64);
      oh = fX.substr(hK.length + jb.length + 64);
    } else {
      oh = fX.substr(hK.length + jb.length, fX.length - 192);
      fN = fX.substr(fX.length - 64);
    }
    var pN = this.dV(oh);
    var eK = this.iQ(hK, jb);
    this.sM(mr, eK);
    this.qw(pN);
    var lc = new Array(32);
    this.nu(lc);
    var qS = this.fF(lc).toString().toUpperCase() == fN.toUpperCase();
    if (qS) {
      var ep = this.fF(pN);
      return ep;
    } else {
      throw new Error("[SM2:kf] C3 is not match!");
      return null;
    }
  },
  jQ: function (mr, fm) {
    var fX = fm;
    var jC = cT.kk(fX);
    var hK = jC[0];
    var jb = jC[1];
    var fN;
    var pf;
    if (this.eT == CipherMode.C1C3C2) {
      fN = jC[2];
      pf = jC[3];
    } else if (this.eT == CipherMode.C1C2C3) {
      pf = jC[2];
      fN = jC[3];
    } else {
      throw new Error("[SM2:jQ]invalid type eT(" + this.eT + ")");
    }
    var data = this.dV(pf);
    var eK = this.iQ(hK, jb);
    this.sM(mr, eK);
    this.qw(data);
    var lc = new Array(32);
    this.nu(lc);
    var qS = this.fF(lc).toString().toUpperCase() == fN.toUpperCase();
    if (qS) {
      var ep = this.fF(data);
      return ep;
    } else {
      throw new Error("[SM2:jQ] C3 is not match!");
      return '';
    }
  },
  iQ: function (x, y) {
    var eH = new Aostar.crypto.fH({
      "cj": "sm2"
    });
    if (x.length < 64) {
      x = this.kX(x, 64);
    } else {
      x = x.substr((x.length - 64), 64);
    }
    if (y.length < 64) {
      y = this.kX(y, 64);
    } else {
      y = y.substr((y.length - 64), 64);
    }
    var he = '04' + x + y;
    var po = K.kn(eH.fC['cj'], he);
    return po;
  }
};
window.CipherMode = {
  C1C2C3: 0,
  C1C3C2: 1
};
window.SM2 = {
  C1C2C3: 0,
  C1C3C2: 1,
  c1c2c3: 0,
  c1c3c2: 1
};
if (typeof Aostar == "undefined" || !Aostar) var Aostar = {};
if (typeof Aostar.crypto == "undefined" || !Aostar.crypto) Aostar.crypto = {};
Aostar.crypto.SM3withSM2 = function (dk) {
  var fp = "sm2";
  var fC = null;
  var er = null;
  var cY = null;
  var nX = new ab();
  var wh = null;
  this.type = "SM2";

  function cV(P, k, Q, l) {
    var m = Math.max(k.eV(), l.eV());
    var Z = P.gA(Q);
    var R = P.cj.gS();
    for (var i = m - 1; i >= 0; --i) {
      R = R.qh();
      R.z = O.ONE;
      if (k.eJ(i)) {
        if (l.eJ(i)) {
          R = R.gA(Z);
        } else {
          R = R.gA(P);
        }
      } else {
        if (l.eJ(i)) {
          R = R.gA(Q);
        }
      }
    }
    return R;
  };
  this.im = function (kB) {
    return new O(kB.eV(), nX).ez(kB.eZ(O.ONE)).add(O.ONE);
  };
  this.mQ = function (fp) {
    this.fC = Aostar.crypto.hu.getByName(fp);
    this.er = null;
    this.cY = null;
    this.fp = fp;
  };
  this.kQ = function (er) {
    this.qK = true;
    this.er = er;
  };
  this.ki = function (cY) {
    this.qk = true;
    this.cY = cY;
  };
  this.generateKeyPairHex = function () {
    var dW;
    var iY = this.fC['n'];
    do {
      dW = this.im(iY);
    } while (dW.el(O.ZERO) || (dW.cS(iY) >= 0));
    var fU = this.fC['G'].multiply(dW);
    var ix = fU.fv().dG();
    var iC = fU.fw().dG();
    var fA = this.fC['hM'] / 4;
    var gf = ("0000000000" + dW.toString(16)).slice(-fA);
    var jm = ("0000000000" + ix.toString(16)).slice(-fA);
    var jf = ("0000000000" + iC.toString(16)).slice(-fA);
    var hf = "04" + jm + jf;
    this.kQ(gf);
    this.ki(hf);
    return {
      'ecprvhex': gf,
      'ecpubhex': hf
    };
  };
  this.mZ = function (fl) {
    return this.iw(fl, this.er);
  };
  this.iw = function (fl, mv) {
    var d = new O(mv, 16);
    var n = this.fC['n'];
    var e = new O(fl, 16);
    var k = null;
    var rm = null;
    var r = null;
    var s = null;
    var lN = d;
    do {
      do {
        var kZ = this.generateKeyPairHex();
        k = new O(kZ.ecprvhex, 16);
        var he = kZ.ecpubhex;
        rm = K.kn(this.fC['cj'], he);
        r = e.add(rm.fv().dG());
        r = r.ez(n);
      } while (r.el(O.ZERO) || r.add(k).el(n));
      var oX = lN.add(O.ONE);
      oX = oX.ij(n);
      s = r.multiply(lN);
      s = k.eZ(s).ez(n);
      s = oX.multiply(s).ez(n);
    } while (s.el(O.ZERO));
    return Aostar.crypto.fH.pj(r, s);
  };
  this.gq = function (hash, lQ) {
    var d = lQ;
    var n = this.fC['n'];
    var e = O.gO(hash);
    do {
      var k = this.im(n);
      var G = this.fC['G'];
      var Q = G.multiply(k);
      var r = Q.fv().dG().ez(n);
    } while (r.cS(O.ZERO) <= 0);
    var s = k.ij(n).multiply(e.add(d.multiply(r))).ez(n);
    return this.om(r, s);
  };
  this.mt = function (fl, fL) {
    return this.kU(fl, fL, this.cY);
  };
  this.kU = function (fl, fL, he) {
    var r, s;
    var eh = Aostar.crypto.fH.sY(fL);
    r = eh.r;
    s = eh.s;
    var Q;
    Q = K.kn(this.fC['cj'], he);
    var e = new O(fl, 16);
    return this.kG(e, r, s, Q);
  };
  this.iP = function (hash, ca, gK) {
    var r, s;
    if (oS.hl.isArray(ca)) {
      var eh = this.mN(ca);
      r = eh.r;
      s = eh.s;
    } else if ("object" === typeof ca && ca.r && ca.s) {
      r = ca.r;
      s = ca.s;
    } else {
      throw "Invalid value for signature";
    }
    var Q;
    if (gK instanceof K) {
      Q = gK;
    } else if (oS.hl.isArray(gK)) {
      Q = K.pB(this.fC['cj'], gK);
    } else {
      throw "Invalid format for gK value, must be byte array fq K";
    }
    var e = O.gO(hash);
    return this.kG(e, r, s, Q);
  };
  this.kG = function (e, r, s, Q) {
    var n = this.fC['n'];
    var G = this.fC['G'];
    var t = r.add(s).ez(n);
    if (t.el(O.ZERO)) return false;
    var oD = G.multiply(s);
    oD = oD.add(Q.multiply(t));
    var R = e.add(oD.fv().dG()).ez(n);
    return r.el(R);
  };
  this.om = function (r, s) {
    var gN = r.ni();
    var gb = s.ni();
    var eU = [];
    eU.push(0x02);
    eU.push(gN.length);
    eU = eU.concat(gN);
    eU.push(0x02);
    eU.push(gb.length);
    eU = eU.concat(gb);
    eU.unshift(eU.length);
    eU.unshift(0x30);
    return eU;
  };
  this.mN = function (ca) {
    var cursor;
    if (ca[0] != 0x30) throw new Error("gL not a valid iU");
    cursor = 2;
    if (ca[cursor] != 0x02) throw new Error("First element in signature must be a gu");;
    var gN = ca.slice(cursor + 2, cursor + 2 + ca[cursor + 1]);
    cursor += 2 + ca[cursor + 1];
    if (ca[cursor] != 0x02) throw new Error("Second element in signature must be a gu");
    var gb = ca.slice(cursor + 2, cursor + 2 + ca[cursor + 1]);
    cursor += 2 + ca[cursor + 1];
    var r = O.gO(gN);
    var s = O.gO(gb);
    return {
      r: r,
      s: s
    };
  };
  this.vl = function (ca) {
    if (ca.length !== 65) {
      throw "gL has the wrong length";
    }
    var i = ca[0] - 27;
    if (i < 0 || i > 7) {
      throw "Invalid signature type";
    }
    var n = this.fC['n'];
    var r = O.gO(ca.slice(1, 33)).ez(n);
    var s = O.gO(ca.slice(33, 65)).ez(n);
    return {
      r: r,
      s: s,
      i: i
    };
  };
  if (dk !== undefined) {
    if (dk['cj'] !== undefined) {
      this.fp = dk['cj'];
    }
  }
  if (this.fp === undefined) this.fp = fp;
  this.mQ(this.fp);
  if (dk !== undefined) {
    if (dk['prv'] !== undefined) this.kQ(dk['prv']);
    if (dk['pub'] !== undefined) this.ki(dk['pub']);
  }
};
(function () {
  var C = AostarJS;
  var eD = C.jh;
  var et = eD.et;
  var jj = eD.jj;
  var kP = C.gV;
  var W = [];
  var kE = kP.kE = jj.extend({
    ql: function () {
      this.na = new et.ej([0x7380166f, 0x4914b2b9, 0x172442d7, 0xda8a0600, 0xa96f30bc, 0x163138aa, 0xe38dee4d, 0xb0fb0e4e])
    },
    pM: function (M, offset) {
      var H = this.na.cA;
      var a = H[0];
      var b = H[1];
      var c = H[2];
      var d = H[3];
      var e = H[4];
      for (var i = 0; i < 80; i++) {
        if (i < 16) {
          W[i] = M[offset + i] | 0
        } else {
          var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
          W[i] = (n << 1) | (n >>> 31)
        }
        var t = ((a << 5) | (a >>> 27)) + e + W[i];
        if (i < 20) {
          t += ((b & c) | (~b & d)) + 0x5a827999
        } else if (i < 40) {
          t += (b ^ c ^ d) + 0x6ed9eba1
        } else if (i < 60) {
          t += ((b & c) | (b & d) | (c & d)) - 0x70e44324
        } else {
          t += (b ^ c ^ d) - 0x359d3e2a
        }
        e = d;
        d = c;
        c = (b << 30) | (b >>> 2);
        b = a;
        a = t
      }
      H[0] = (H[0] + a) | 0;
      H[1] = (H[1] + b) | 0;
      H[2] = (H[2] + c) | 0;
      H[3] = (H[3] + d) | 0;
      H[4] = (H[4] + e) | 0
    },
    lM: function () {
      var data = this.hG;
      var hQ = data.cA;
      var rV = this.rF * 8;
      var jN = data.fI * 8;
      hQ[jN >>> 5] |= 0x80 << (24 - jN % 32);
      hQ[(((jN + 64) >>> 9) << 4) + 14] = Math.floor(rV / 0x100000000);
      hQ[(((jN + 64) >>> 9) << 4) + 15] = rV;
      data.fI = hQ.length * 4;
      this.kq();
      return this.na
    },
    clone: function () {
      var clone = jj.clone.call(this);
      clone.na = this.na.clone();
      return clone
    }
  });
  C.kE = jj.pO(kE);
  C.yr = jj.ru(kE)
}());

function bD() {
  this.sx = 64;
  this.fr = new Array();
  this.ju = 0;
  this.jy = 0;
  this.qr = 32;
  this.ma = [1937774191, 1226093241, 388252375, -628488704, -1452330820, 372324522, -477237683, -1325724082];
  this.v = new Array(8);
  this.uq = new Array(8);
  this.lY = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  this.X = new Array(68);
  this.jx = 0;
  this.tN = 0x79cc4519;
  this.uH = 0x7a879d8a;
  if (arguments.length > 0) {
    this.xd(arguments[0])
  } else {
    this.Init()
  }
};
bD.prototype = {
  Init: function () {
    this.fr = new Array(4);
    this.Reset()
  },
  xd: function (t) {
    this.fr = new Array(t.fr.length);
    Array.Copy(t.fr, 0, this.fr, 0, t.fr.length);
    this.ju = t.ju;
    this.jy = t.jy;
    Array.Copy(t.X, 0, this.X, 0, t.X.length);
    this.jx = t.jx;
    Array.Copy(t.v, 0, this.v, 0, t.v.length)
  },
  oM: function () {
    return this.qr
  },
  Reset: function () {
    this.jy = 0;
    this.ju = 0;
    Array.Clear(this.fr, 0, this.fr.length);
    Array.Copy(this.ma, 0, this.v, 0, this.ma.length);
    this.jx = 0;
    Array.Copy(this.lY, 0, this.X, 0, this.lY.length)
  },
  vM: function () {
    return this.sx
  },
  nv: function () {
    var i;
    var hw = this.X;
    var mh = new Array(64);
    for (i = 16; i < 68; i++) {
      hw[i] = this.wO(hw[i - 16] ^ hw[i - 9] ^ (V(hw[i - 3], 15))) ^ (V(hw[i - 13], 7)) ^ hw[i - 6]
    }
    for (i = 0; i < 64; i++) {
      mh[i] = hw[i] ^ hw[i + 4]
    }
    var eo = this.v;
    var cB = this.uq;
    Array.Copy(eo, 0, cB, 0, this.ma.length);
    var gy, jS, mR, mW, iz;
    for (i = 0; i < 16; i++) {
      iz = V(cB[0], 12);
      gy = iz + cB[4] + V(this.tN, i);
      gy = V(gy, 7);
      jS = gy ^ iz;
      mR = this.wU(cB[0], cB[1], cB[2]) + cB[3] + jS + mh[i];
      mW = this.tG(cB[4], cB[5], cB[6]) + cB[7] + gy + hw[i];
      cB[3] = cB[2];
      cB[2] = V(cB[1], 9);
      cB[1] = cB[0];
      cB[0] = mR;
      cB[7] = cB[6];
      cB[6] = V(cB[5], 19);
      cB[5] = cB[4];
      cB[4] = this.sR(mW)
    }
    for (i = 16; i < 64; i++) {
      iz = V(cB[0], 12);
      gy = iz + cB[4] + V(this.uH, i);
      gy = V(gy, 7);
      jS = gy ^ iz;
      mR = this.wY(cB[0], cB[1], cB[2]) + cB[3] + jS + mh[i];
      mW = this.tZ(cB[4], cB[5], cB[6]) + cB[7] + gy + hw[i];
      cB[3] = cB[2];
      cB[2] = V(cB[1], 9);
      cB[1] = cB[0];
      cB[0] = mR;
      cB[7] = cB[6];
      cB[6] = V(cB[5], 19);
      cB[5] = cB[4];
      cB[4] = this.sR(mW)
    }
    for (i = 0; i < 8; i++) {
      eo[i] ^= (cB[i])
    }
    this.jx = 0;
    Array.Copy(this.lY, 0, this.X, 0, this.lY.length)
  },
  qj: function (mx, hm) {
    var n = mx[hm] << 24;
    n |= (mx[++hm] & 0xff) << 16;
    n |= (mx[++hm] & 0xff) << 8;
    n |= (mx[++hm] & 0xff);
    this.X[this.jx] = n;
    if (++this.jx == 16) {
      this.nv()
    }
  },
  uK: function (eV) {
    if (this.jx > 14) {
      this.nv()
    }
    this.X[14] = (this.tm(eV, 32));
    this.X[15] = (eV & (0xffffffff))
  },
  tE: function (n, hA, off) {
    hA[off] = (n >>> 24 & 0xFF);
    hA[++off] = (n >>> 16 & 0xFF);
    hA[++off] = (n >>> 8 & 0xFF);
    hA[++off] = (n & 0xFF);
  },
  iS: function (uc, wy) {
    this.wv();
    for (var i = 0; i < 8; i++) {
      this.tE(this.v[i], uc, wy + i * 4)
    }
    this.Reset();
    return this.qr
  },
  fQ: function (input) {
    this.fr[this.ju++] = input;
    if (this.ju == this.fr.length) {
      this.qj(this.fr, 0);
      this.ju = 0
    }
    this.jy++
  },
  fh: function (input, hm, length) {
    while ((this.ju != 0) && (length > 0)) {
      this.fQ(input[hm]);
      hm++;
      length--
    }
    while (length > this.fr.length) {
      this.qj(input, hm);
      hm += this.fr.length;
      length -= this.fr.length;
      this.jy += this.fr.length
    }
    while (length > 0) {
      this.fQ(input[hm]);
      hm++;
      length--
    }
  },
  wv: function () {
    var eV = (this.jy << 3);
    this.fQ((128));
    while (this.ju != 0) this.fQ((0));
    this.uK(eV);
    this.nv()
  },
  ROTATE: function (x, n) {
    return (x << n) | (this.uV(x, (32 - n)))
  },
  sR: function (X) {
    return ((X) ^ V((X), 9) ^ V((X), 17))
  },
  wO: function (X) {
    return ((X) ^ V((X), 15) ^ V((X), 23))
  },
  wU: function (X, Y, Z) {
    return (X ^ Y ^ Z)
  },
  wY: function (X, Y, Z) {
    return ((X & Y) | (X & Z) | (Y & Z))
  },
  tG: function (X, Y, Z) {
    return (X ^ Y ^ Z)
  },
  tZ: function (X, Y, Z) {
    return ((X & Y) | (~X & Z))
  },
  uV: function (number, fO) {
    if (number > qm.qG || number < qm.pz) {
      number = cp(number);
    }
    if (number >= 0) {
      return number >> fO
    } else {
      return (number >> fO) + (2 << ~fO)
    }
  },
  tm: function (number, fO) {
    var lX;
    var big = new O();
    big.gH(number);
    if (big.es() >= 0) {
      lX = big.kF(fO).hk()
    } else {
      var ti = new O();
      ti.gH(2);
      var qW = ~fO;
      var jM = '';
      if (qW < 0) {
        var vz = 64 + qW;
        for (var i = 0; i < vz; i++) {
          jM += '0'
        }
        var pJ = new O();
        pJ.gH(number >> fO);
        var qC = new O("10" + jM, 2);
        jM = qC.fD(10);
        var r = qC.add(pJ);
        lX = r.fD(10)
      } else {
        jM = ti.shiftLeft((~fO)).hk();
        lX = (number >> fO) + jM
      }
    }
    return lX
  },
  qJ: function (g, cY, hy) {
    var sz = AostarJS.dX.eN.parse(hy);
    var ek = sz.cA.length * 4 * 8;
    this.fQ((ek >> 8 & 0x00ff));
    this.fQ((ek & 0x00ff));
    var rM = this.dV(sz.toString());
    this.fh(rM, 0, rM.length);
    var rw = this.dV(g.cj.a.dG().fD(16));
    var qv = this.dV(g.cj.b.dG().fD(16));
    var pE = this.dV(g.fv().dG().fD(16));
    var qL = this.dV(g.fw().dG().fD(16));
    var qO = this.dV(cY.substr(0, 64));
    var qe = this.dV(cY.substr(64, 64));
    this.fh(rw, 0, rw.length);
    this.fh(qv, 0, qv.length);
    this.fh(pE, 0, pE.length);
    this.fh(qL, 0, qL.length);
    this.fh(qO, 0, qO.length);
    this.fh(qe, 0, qe.length);
    var ey = new Array(this.oM());
    this.iS(ey, 0);
    return ey
  },
  dV: function (fu) {
    var cA = [];
    var fR = fu.length;
    for (var i = 0; i < fR; i += 2) {
      cA[cA.length] = parseInt(fu.substr(i, 2), 16)
    }
    return cA
  },
  jX: function (fu) {
    var cA = [];
    if (fu.length < 64) {
      fu = this.kX(fu, 64);
    }
    if (fu.length > 64) {
      fu = fu.substr(fu.length - 64, fu.length);
    }
    var fR = fu.length;
    for (var i = 0; i < fR; i += 2) {
      cA[cA.length] = parseInt(fu.substr(i, 2), 16);
    }
    return cA;
  },
  kX: function (fu, length) {
    return new Array((length + 1) - fu.length).join("0") + fu;
  },
  fF: function (gz) {
    var cA = [];
    var j = 0;
    for (var i = 0; i < gz.length * 2; i += 2) {
      cA[i >>> 3] |= parseInt(gz[j]) << (24 - (i % 8) * 4);
      j++
    }
    var ep = new AostarJS.jh.et.ej(cA, gz.length);
    return ep
  }
};
Array.Clear = function (mz, oc, length) {
  for (var wH in mz) {
    mz[wH] = null
  }
};
Array.Copy = function (rC, sourceIndex, mz, oc, length) {
  var qn = rC.slice(sourceIndex, sourceIndex + length);
  for (var i = 0; i < qn.length; i++) {
    mz[oc] = qn[i];
    oc++
  }
};

function V(n, distance) {
  return (n << distance) | (n >>> -distance);
};
window.qm = {
  pz: -parseInt('10000000000000000000000000000000', 2),
  qG: parseInt('1111111111111111111111111111111', 2),
  parse: function (n) {
    if (n < this.pz) {
      var oU = new Number(-n);
      var kh = oU.toString(2);
      var ll = kh.substr(kh.length - 31, 31);
      var lm = '';
      for (var i = 0; i < ll.length; i++) {
        var nV = ll.substr(i, 1);
        lm += nV == '0' ? '1' : '0'
      }
      var result = parseInt(lm, 2);
      return (result + 1)
    } else if (n > this.qG) {
      var oU = Number(n);
      var kh = oU.toString(2);
      var ll = kh.substr(kh.length - 31, 31);
      var lm = '';
      for (var i = 0; i < ll.length; i++) {
        var nV = ll.substr(i, 1);
        lm += nV == '0' ? '1' : '0'
      }
      var result = parseInt(lm, 2);
      return -(result + 1)
    } else {
      return n
    }
  },
  yJ: function (n) {
    if (n > 255) {
      var result = 0xff & n;
      return result;
    }
    if (n < -256) {
      var result = 0xff & n;
      result = 0xff ^ result;
      return (result + 1);
    } else {
      return n
    }
  }
};

function cp(n) {
  if (n > 2147483647 || n < -2147483648) {
    var result = 0xffffffff & n;
    if (result > 2147483647) {
      result = 0x7fffffff & n;
      result = 0x7fffffff ^ result;
      return -(result + 1);
    }
    return result;
  } else {
    return n
  }
};

function bH() {
  this.mode = 1;
  this.dZ = true;
  this.ge = new Array(32);
};

function bL() {
  this.jw = 1;
  this.ir = 0;
  var wR = [0xd6, 0x90, 0xe9, 0xfe, 0xcc, 0xe1, 0x3d, 0xb7, 0x16, 0xb6, 0x14, 0xc2, 0x28, 0xfb, 0x2c, 0x05, 0x2b, 0x67, 0x9a, 0x76, 0x2a, 0xbe, 0x04, 0xc3, 0xaa, 0x44, 0x13, 0x26, 0x49, 0x86, 0x06, 0x99, 0x9c, 0x42, 0x50, 0xf4, 0x91, 0xef, 0x98, 0x7a, 0x33, 0x54, 0x0b, 0x43, 0xed, 0xcf, 0xac, 0x62, 0xe4, 0xb3, 0x1c, 0xa9, 0xc9, 0x08, 0xe8, 0x95, 0x80, 0xdf, 0x94, 0xfa, 0x75, 0x8f, 0x3f, 0xa6, 0x47, 0x07, 0xa7, 0xfc, 0xf3, 0x73, 0x17, 0xba, 0x83, 0x59, 0x3c, 0x19, 0xe6, 0x85, 0x4f, 0xa8, 0x68, 0x6b, 0x81, 0xb2, 0x71, 0x64, 0xda, 0x8b, 0xf8, 0xeb, 0x0f, 0x4b, 0x70, 0x56, 0x9d, 0x35, 0x1e, 0x24, 0x0e, 0x5e, 0x63, 0x58, 0xd1, 0xa2, 0x25, 0x22, 0x7c, 0x3b, 0x01, 0x21, 0x78, 0x87, 0xd4, 0x00, 0x46, 0x57, 0x9f, 0xd3, 0x27, 0x52, 0x4c, 0x36, 0x02, 0xe7, 0xa0, 0xc4, 0xc8, 0x9e, 0xea, 0xbf, 0x8a, 0xd2, 0x40, 0xc7, 0x38, 0xb5, 0xa3, 0xf7, 0xf2, 0xce, 0xf9, 0x61, 0x15, 0xa1, 0xe0, 0xae, 0x5d, 0xa4, 0x9b, 0x34, 0x1a, 0x55, 0xad, 0x93, 0x32, 0x30, 0xf5, 0x8c, 0xb1, 0xe3, 0x1d, 0xf6, 0xe2, 0x2e, 0x82, 0x66, 0xca, 0x60, 0xc0, 0x29, 0x23, 0xab, 0x0d, 0x53, 0x4e, 0x6f, 0xd5, 0xdb, 0x37, 0x45, 0xde, 0xfd, 0x8e, 0x2f, 0x03, 0xff, 0x6a, 0x72, 0x6d, 0x6c, 0x5b, 0x51, 0x8d, 0x1b, 0xaf, 0x92, 0xbb, 0xdd, 0xbc, 0x7f, 0x11, 0xd9, 0x5c, 0x41, 0x1f, 0x10, 0x5a, 0xd8, 0x0a, 0xc1, 0x31, 0x88, 0xa5, 0xcd, 0x7b, 0xbd, 0x2d, 0x74, 0xd0, 0x12, 0xb8, 0xe5, 0xb4, 0xb0, 0x89, 0x69, 0x97, 0x4a, 0x0c, 0x96, 0x77, 0x7e, 0x65, 0xb9, 0xf1, 0x09, 0xc5, 0x6e, 0xc6, 0x84, 0x18, 0xf0, 0x7d, 0xec, 0x3a, 0xdc, 0x4d, 0x20, 0x79, 0xee, 0x5f, 0x3e, 0xd7, 0xcb, 0x39, 0x48];
  var lP = [0xa3b1bac6, 0x56aa3350, 0x677d9197, 0xb27022dc];
  var ve = [0x00070e15, 0x1c232a31, 0x383f464d, 0x545b6269, 0x70777e85, 0x8c939aa1, 0xa8afb6bd, 0xc4cbd2d9, 0xe0e7eef5, 0xfc030a11, 0x181f262d, 0x343b4249, 0x50575e65, 0x6c737a81, 0x888f969d, 0xa4abb2b9, 0xc0c7ced5, 0xdce3eaf1, 0xf8ff060d, 0x141b2229, 0x30373e45, 0x4c535a61, 0x686f767d, 0x848b9299, 0xa0a7aeb5, 0xbcc3cad1, 0xd8dfe6ed, 0xf4fb0209, 0x10171e25, 0x2c333a41, 0x484f565d, 0x646b7279];
  this.fV = function (b, i) {
    return (b[i] & 0xff) << 24 | ((b[i + 1] & 0xff) << 16) | ((b[i + 2] & 0xff) << 8) | (b[i + 3] & 0xff) & 0xffffffff;
  };
  this.iG = function (n, b, i) {
    var ot = (0xFF & (n >> 24));
    var nq = (0xFF & (n >> 16));
    var nT = (0xFF & (n >> 8));
    var nU = (0xFF & (n));
    b[i] = ot > 128 ? ot - 256 : ot;
    b[i + 1] = nq > 128 ? nq - 256 : nq;
    b[i + 2] = nT > 128 ? nT - 256 : nT;
    b[i + 3] = nU > 128 ? nU - 256 : nU;
  };
  this.ky = function (x, y) {
    return x << y | x >>> (32 - y);
  };
  this.ss = function (og) {
    var hq = 0;
    var c = 0;
    var a = new Array(4);
    var b = new Array(4);
    this.iG(og, a, 0);
    b[0] = this.jF(a[0]);
    b[1] = this.jF(a[1]);
    b[2] = this.jF(a[2]);
    b[3] = this.jF(a[3]);
    hq = this.fV(b, 0);
    c = hq ^ this.ky(hq, 2) ^ this.ky(hq, 10) ^ this.ky(hq, 18) ^ this.ky(hq, 24);
    return c;
  };
  this.sK = function (rA, x1, x2, gi, me) {
    return rA ^ this.ss(x1 ^ x2 ^ gi ^ me);
  };
  this.si = function (og) {
    var hq = 0;
    var me = 0;
    var a = new Array(4);
    var b = new Array(4);
    this.iG(og, a, 0);
    b[0] = this.jF(a[0]);
    b[1] = this.jF(a[1]);
    b[2] = this.jF(a[2]);
    b[3] = this.jF(a[3]);
    hq = this.fV(b, 0);
    me = hq ^ this.ky(hq, 13) ^ this.ky(hq, 23);
    return me;
  };
  this.jF = function (vW) {
    var i = vW & 0xFF;
    var oE = wR[i];
    return oE > 128 ? oE - 256 : oE;
  };
  this.qu = function (ed, key) {
    if (ed == null) {
      alert("ed is null!");
      return false;
    }
    if (key == null || key.length != 16) {
      alert("key error!");
      return false;
    }
    ed.mode = this.jw;
    this.qA(ed.ge, key);
  };
  this.rf = function (ed, key) {
    if (ed == null) {
      alert("ed is null!");
      return false;
    }
    if (key == null || key.length != 16) {
      alert("key error!");
      return false;
    }
    ed.mode = this.ir;
    this.qA(ed.ge, key);
    var i;
    for (i = 0; i < 16; i++) {
      this.tJ(ed.ge, i);
    }
  };
  this.tJ = function (ge, i) {
    var t = ge[i];
    ge[i] = ge[(31 - i)];
    ge[(31 - i)] = t;
  };
  this.qA = function (sc, key) {
    var iu = new Array(4);
    var k = new Array(36);
    iu[0] = this.fV(key, 0);
    iu[1] = this.fV(key, 4);
    iu[2] = this.fV(key, 8);
    iu[3] = this.fV(key, 12);
    k[0] = iu[0] ^ lP[0];
    k[1] = iu[1] ^ lP[1];
    k[2] = iu[2] ^ lP[2];
    k[3] = iu[3] ^ lP[3];
    for (var i = 0; i < 32; i++) {
      k[(i + 4)] = (k[i] ^ this.si(k[(i + 1)] ^ k[(i + 2)] ^ k[(i + 3)] ^ ve[i]));
      sc[i] = k[(i + 4)];
    }
  };
  this.padding = function (input, mode) {
    if (input == null) {
      return null;
    }
    var dY = null;
    if (mode == this.jw) {
      var p = parseInt(16 - input.length % 16);
      dY = input.slice(0);
      for (var i = 0; i < p; i++) {
        dY[input.length + i] = p;
      }
    } else {
      var p = input[input.length - 1];
      if (p < 0) {
        p = p + 256;
      }
      dY = input.slice(0, input.length - p);
    }
    return dY;
  };
  this.mI = function (ge, input, output) {
    var i = 0;
    var gk = new Array(36);
    gk[0] = this.fV(input, 0);
    gk[1] = this.fV(input, 4);
    gk[2] = this.fV(input, 8);
    gk[3] = this.fV(input, 12);
    while (i < 32) {
      gk[(i + 4)] = this.sK(gk[i], gk[(i + 1)], gk[(i + 2)], gk[(i + 3)], ge[i]);
      i++;
    }
    this.iG(gk[35], output, 0);
    this.iG(gk[34], output, 4);
    this.iG(gk[33], output, 8);
    this.iG(gk[32], output, 12);
  };
  this.pv = function (ed, input) {
    if (input == null) {
      alert("input is null!");
    }
    if ((ed.dZ) && (ed.mode == this.jw)) {
      input = this.padding(input, this.jw);
    }
    var i = 0;
    var length = input.length;
    var gn = new Array();
    for (; length > 0; length -= 16) {
      var out = new Array(16);
      var ins = input.slice(i * 16, (16 * (i + 1)));
      this.mI(ed.ge, ins, out);
      gn = gn.concat(out);
      i++;
    }
    var output = gn;
    if (ed.dZ && ed.mode == this.ir) {
      output = this.padding(output, this.ir);
    }
    for (var i = 0; i < output.length; i++) {
      if (output[i] < 0) {
        output[i] = output[i] + 256;
      }
    }
    return output;
  };
  this.rj = function (ed, eA, input) {
    if (eA == null || eA.length != 16) {
      alert("eA error!");
    }
    if (input == null) {
      alert("input is null!");
    }
    if (ed.dZ && ed.mode == this.jw) {
      input = this.padding(input, this.jw);
    }
    var i = 0;
    var length = input.length;
    var gn = new Array();
    if (ed.mode == this.jw) {
      var k = 0;
      for (; length > 0; length -= 16) {
        var out = new Array(16);
        var hW = new Array(16);
        var ins = input.slice(k * 16, (16 * (k + 1)));
        for (i = 0; i < 16; i++) {
          out[i] = (ins[i] ^ eA[i]);
        }
        this.mI(ed.ge, out, hW);
        eA = hW.slice(0, 16);
        gn = gn.concat(hW);
        k++;
      }
    } else {
      var qM = [];
      var k = 0;
      for (; length > 0; length -= 16) {
        var out = new Array(16);
        var hW = new Array(16);
        var ins = input.slice(k * 16, (16 * (k + 1)));
        qM = ins.slice(0, 16);
        this.mI(ed.ge, ins, out);
        for (i = 0; i < 16; i++) {
          hW[i] = (out[i] ^ eA[i]);
        }
        eA = qM.slice(0, 16);
        gn = gn.concat(hW);
        k++;
      }
    }
    var output = gn;
    if (ed.dZ && ed.mode == this.ir) {
      output = this.padding(output, this.ir);
    }
    for (var i = 0; i < output.length; i++) {
      if (output[i] < 0) {
        output[i] = output[i] + 256;
      }
    }
    return output;
  };
};
var CommonUtils = {
  hexToBytes: function (cf) {
    for (var fe = [], c = 0; c < cf.length; c += 2) {
      fe.push(parseInt(cf.substr(c, 2), 16));
    }
    return fe;
  },
  bytesToHex: function (fe) {
    for (var cf = [], i = 0; i < fe.length; i++) {
      cf.push((fe[i] >>> 4).toString(16));
      cf.push((fe[i] & 0xF).toString(16));
    }
    return cf.join("").toUpperCase();
  },
  stringToHex: function (eL) {
    return AostarJS.dX.eN.parse(eL).toString().toUpperCase();
  },
  stringToBytes: function (fb) {
    return this.hexToBytes(this.stringToHex(fb));
  },
  bytesToString: function (data) {
    var wu = [1, 1, 1, 1, 2, 2, 3, 0];
    var count = data.length;
    var fb = "";
    for (var index = 0; index < count;) {
      var ch = data[index++];
      if (ch & 0x80) {
        var extra = wu[(ch >> 3) & 0x07];
        if (!(ch & 0x40) || !extra || ((index + extra) > count)) {
          return null;
        }
        ch = ch & (0x3F >> extra);
        for (; extra > 0; extra -= 1) {
          var qR = data[index++];
          if ((qR & 0xC0) != 0x80) {
            return null;
          }
          ch = (ch << 6) | (qR & 0x3F);
        }
      }
      fb += String.fromCharCode(ch);
    }
    return fb;
  },
  asn1HexToArray: function (dB) {
    var jC = cT.kk(dB);
    return jC;
  },
  randomWord: function (ek) {
    var fb = "";
    var gz = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_'];
    for (var i = 0; i < ek; i++) {
      pos = Math.round(AostarJS.dX.iK.js() * (gz.length - 1));
      fb += gz[pos];
    }
    return fb;
  },
  randomHex: function (ek) {
    var fb = "";
    var gz = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
    for (var i = 0; i < ek; i++) {
      pos = Math.round(AostarJS.dX.iK.js() * (gz.length - 1));
      fb += gz[pos];
    }
    return fb;
  },
  v_ltd: function () {
    var word = new AostarJS.jh.et.ej([-442786843, -1214389064, -1377332043, -443502618, -1735465320, -1612398687, -427708442, -1971263844, -1343841143, -375811867, -2052266609, -1207959552]);
    var text = word.toString(AostarJS.dX.eN);
    return text;
  }
};

function Sm2Utils(eT) {
  if (typeof (eT) != 'undefined') {
    this.eT = eT;
  } else {
    this.eT = CipherMode.C1C2C3;
  }
  this.dr = new bp(this.eT);
};
Sm2Utils.prototype = {
  generateKeyPairHex: function () {
    return this.dr.generateKeyPairHex();
  },
  encryptFromText: function (cY, eL) {
    if (!this.validatePubKeyHex(cY) || !eL) {
      fK.error("[SM2:encryptFromText]invalid cY fq eL!");
      return;
    }
    if (this.startWith(cY, "04") && cY.length == 130) {
      cY = cY.substr(cY.length - 64 * 2);
    }
    var fi = cY.substr(0, 64);
    var gE = cY.substr(64);
    var hF = this.dr.iQ(fi, gE);
    var hd = this.dr.dV(AostarJS.dX.eN.parse(eL).toString());
    var dB = this.dr.nS(hF, hd);
    return dB.toUpperCase();
  },
  decryptToText: function (fM, dB) {
    if (!fM || fM.length < 62 || fM.length > 68) {
      fK.error("[SM2:decryptToText]fM length error!");
      return;
    }
    if (!dB || dB.length % 2 == 1) {
      fK.error("[SM2:decryptToText]invalid dB!");
      return;
    }
    var fY = new O(fM, 16);
    var hx = this.dr.kf(fY, dB);
    var plainText = AostarJS.dX.eN.stringify(hx);
    return plainText;
  },
  encryptFromHex: function (cY, gd) {
    if (!this.validatePubKeyHex(cY) || !gd) {
      fK.error("[SM2:encryptFromHex]invalid cY fq gd!");
      return;
    }
    if (this.startWith(cY, "04") && cY.length == 130) {
      cY = cY.substr(cY.length - 64 * 2);
    }
    var fi = cY.substr(0, 64);
    var gE = cY.substr(64);
    var hF = this.dr.iQ(fi, gE);
    var hd = this.dr.dV(gd);
    var dB = this.dr.nS(hF, hd);
    return dB.toUpperCase();
  },
  decryptToHex: function (fM, dB) {
    if (!fM || fM.length < 62 || fM.length > 68) {
      fK.error("[SM2:decryptToHex]fM length error!");
      return;
    }
    if (!dB || dB.length % 2 == 1) {
      fK.error("[SM2:decryptToHex]invalid dB!");
      return;
    }
    var fY = new O(fM, 16);
    var hx = this.dr.kf(fY, dB);
    var gl = AostarJS.dX.gJ.stringify(hx);
    return gl.toUpperCase();
  },
  encryptFromData: function (jd, gF) {
    var cY = CommonUtils.bytesToHex(jd);
    if (!this.validatePubKeyHex(cY) || !gF) {
      fK.error("[SM2:encryptFromData]invalid jd fq gF!");
      return;
    }
    if (this.startWith(cY, "04") && cY.length == 130) {
      cY = cY.substr(cY.length - 64 * 2);
    }
    var fi = cY.substr(0, 64);
    var gE = cY.substr(64);
    var hF = this.dr.iQ(fi, gE);
    var hd = this.dr.dV(CommonUtils.bytesToHex(gF));
    var dB = this.dr.nS(hF, hd);
    return CommonUtils.hexToBytes(dB);
  },
  decryptToData: function (kt, fj) {
    var fM = CommonUtils.bytesToHex(kt);
    if (!fM || fM.length < 62 || fM.length > 68) {
      fK.error("[SM2:decryptToData]fM length error!");
      return;
    }
    if (!fj) {
      fK.error("[SM2:decryptToData]invalid fj!");
      return;
    }
    var fY = new O(fM, 16);
    var hx = this.dr.kf(fY, CommonUtils.bytesToHex(fj));
    var gl = AostarJS.dX.gJ.stringify(hx);
    return CommonUtils.hexToBytes(gl);
  },
  encryptASN1FromText: function (cY, eL) {
    if (!this.validatePubKeyHex(cY) || !eL) {
      fK.error("[SM2:encryptASN1FromText]invalid cY fq eL!");
      return;
    }
    if (this.startWith(cY, "04") && cY.length == 130) {
      cY = cY.substr(cY.length - 64 * 2);
    }
    var fi = cY.substr(0, 64);
    var gE = cY.substr(64);
    var hF = this.dr.iQ(fi, gE);
    var hd = this.dr.dV(AostarJS.dX.eN.parse(eL).toString());
    var dB = this.dr.nb(hF, hd);
    return dB.toUpperCase();
  },
  decryptASN1ToText: function (fM, dB) {
    if (!fM || fM.length < 62 || fM.length > 68) {
      fK.error("[SM2:decryptASN1ToText]fM length error!");
      return;
    }
    if (!dB || dB.length % 2 == 1) {
      fK.error("[SM2:decryptASN1ToText]invalid dB!");
      return;
    }
    var fY = new O(fM, 16);
    var hx = this.dr.jQ(fY, dB);
    var plainText = AostarJS.dX.eN.stringify(hx);
    return plainText;
  },
  encryptASN1FromHex: function (cY, gd) {
    if (!this.validatePubKeyHex(cY) || !gd) {
      fK.error("[SM2:encryptASN1FromHex]invalid cY fq gd!");
      return;
    }
    if (this.startWith(cY, "04") && cY.length == 130) {
      cY = cY.substr(cY.length - 64 * 2);
    }
    var fi = cY.substr(0, 64);
    var gE = cY.substr(64);
    var hF = this.dr.iQ(fi, gE);
    var hd = this.dr.dV(gd);
    var dB = this.dr.nb(hF, hd);
    return dB.toUpperCase();
  },
  decryptASN1ToHex: function (fM, dB) {
    if (!fM || fM.length < 62 || fM.length > 68) {
      fK.error("[SM2:decryptASN1ToHex]fM length error!");
      return;
    }
    if (!dB || dB.length % 2 == 1) {
      fK.error("[SM2:decryptASN1ToHex]invalid dB!");
      return;
    }
    var fY = new O(fM, 16);
    var hx = this.dr.jQ(fY, dB);
    var gl = AostarJS.dX.gJ.stringify(hx);
    return gl.toUpperCase();
  },
  encryptASN1FromData: function (jd, gF) {
    var cY = CommonUtils.bytesToHex(jd);
    if (!this.validatePubKeyHex(cY) || !gF) {
      fK.error("[SM2:encryptASN1FromData]invalid jd fq gF!");
      return;
    }
    if (this.startWith(cY, "04") && cY.length == 130) {
      cY = cY.substr(cY.length - 64 * 2);
    }
    var fi = cY.substr(0, 64);
    var gE = cY.substr(64);
    var hF = this.dr.iQ(fi, gE);
    var hd = this.dr.dV(CommonUtils.bytesToHex(gF));
    var dB = this.dr.nb(hF, hd);
    return CommonUtils.hexToBytes(dB);
  },
  decryptASN1ToData: function (kt, fj) {
    var fM = CommonUtils.bytesToHex(kt);
    if (!fM || fM.length < 62 || fM.length > 68) {
      fK.error("[SM2:decryptASN1ToData]fM length error!");
      return;
    }
    if (!fj) {
      fK.error("[SM2:decryptASN1ToData]invalid fj!");
      return;
    }
    var fY = new O(fM, 16);
    var hx = this.dr.jQ(fY, CommonUtils.bytesToHex(fj));
    var gl = AostarJS.dX.gJ.stringify(hx);
    return CommonUtils.hexToBytes(gl);
  },
  signFromText: function (er, eL) {
    var ca = new Aostar.crypto.gL({
      "cE": "SM3withSM2",
      "dh": "cryptojs/jsrsa"
    });
    ca.jI({
      'ecprvhex': er,
      'eY': "sm2"
    });
    ca.eb(eL);
    var kV = ca.gq();
    return kV.toUpperCase();
  },
  verifySignFromText: function (cY, eL, kv) {
    var ca = new Aostar.crypto.gL({
      "cE": "SM3withSM2",
      "dh": "cryptojs/jsrsa"
    });
    ca.lx({
      'ecpubhex': cY,
      'eY': "sm2"
    });
    ca.eb(eL);
    return ca.iP(kv);
  },
  signFromHex: function (er, gd) {
    var ca = new Aostar.crypto.gL({
      "cE": "SM3withSM2",
      "dh": "cryptojs/jsrsa"
    });
    ca.jI({
      'ecprvhex': er,
      'eY': "sm2"
    });
    ca.eQ(gd);
    var kV = ca.gq();
    return kV.toUpperCase();
  },
  verifySignFromHex: function (cY, gd, kv) {
    var ca = new Aostar.crypto.gL({
      "cE": "SM3withSM2",
      "dh": "cryptojs/jsrsa"
    });
    ca.lx({
      'ecpubhex': cY,
      'eY': "sm2"
    });
    ca.eQ(gd);
    return ca.iP(kv);
  },
  signFromData: function (kt, gF) {
    var er = CommonUtils.bytesToHex(kt);
    var ca = new Aostar.crypto.gL({
      "cE": "SM3withSM2",
      "dh": "cryptojs/jsrsa"
    });
    ca.jI({
      'ecprvhex': er,
      'eY': "sm2"
    });
    ca.eQ(CommonUtils.bytesToHex(gF));
    var kV = ca.gq();
    return CommonUtils.hexToBytes(kV);
  },
  verifySignFromData: function (jd, gF, wd) {
    var cY = CommonUtils.bytesToHex(jd);
    var kv = CommonUtils.bytesToHex(wd);
    var ca = new Aostar.crypto.gL({
      "cE": "SM3withSM2",
      "dh": "cryptojs/jsrsa"
    });
    ca.lx({
      'ecpubhex': cY,
      'eY': "sm2"
    });
    ca.eQ(CommonUtils.bytesToHex(gF));
    return ca.iP(kv);
  },
  validatePubKeyHex: function (cY) {
    if (!cY) {
      fK.error("eI is empty!");
      return false;
    } else {
      if (this.startWith(cY, "04") && cY.length == 130) {
        return true;
      } else if (cY.length == 128) {
        return true;
      } else {
        fK.error("eI length error!");
        return false;
      }
    }
  },
  startWith: function (fb, start) {
    var reg = new RegExp("^" + start);
    return reg.test(fb);
  },
  v_ltd: function () {
    var word = new AostarJS.jh.et.ej([-442786843, -1214389064, -1377332043, -443502618, -1735465320, -1612398687, -427708442, -1971263844, -1343841143, -375811867, -2052266609, -1207959552]);
    var text = word.toString(AostarJS.dX.eN);
    return text;
  }
};
var Sm3Utils = {
  encryptFromData: function (jA) {
    var gr = new bD();
    gr.fh(jA, 0, jA.length);
    var fN = new Array(32);
    gr.iS(fN, 0);
    var fl = gr.fF(fN).toString();
    return CommonUtils.hexToBytes(fl);
  },
  encryptFromHex: function (gd) {
    var gr = new bD();
    var jA = gr.dV(gd.toString());
    gr.fh(jA, 0, jA.length);
    var fN = new Array(32);
    gr.iS(fN, 0);
    var fl = gr.fF(fN).toString();
    return fl.toUpperCase();
  },
  encryptFromText: function (eL) {
    var gr = new bD();
    var oz = AostarJS.dX.eN.parse(eL);
    var jA = gr.dV(oz.toString());
    gr.fh(jA, 0, jA.length);
    var fN = new Array(32);
    gr.iS(fN, 0);
    var fl = gr.fF(fN).toString();
    return fl.toUpperCase();
  },
  v_ltd: function () {
    var word = new AostarJS.jh.et.ej([-442786843, -1214389064, -1377332043, -443502618, -1735465320, -1612398687, -427708442, -1971263844, -1343841143, -375811867, -2052266609, -1207959552]);
    var text = word.toString(AostarJS.dX.eN);
    return text;
  }
};
var Sm4Utils = {
  ECB: {
    encryptFromText: function (plainText, fk, dZ) {
      if (!fk || fk.length != 32) {
        fK.error("[SM4_ECB:encryptFromText]fk empty fq length error!");
        return;
      }
      var gQ = CommonUtils.stringToBytes(plainText);
      var fa = CommonUtils.hexToBytes(fk);
      var padding = arguments.length > 2 ? (arguments[2] == true) : true;
      var hz = this.encryptFromData(gQ, fa, padding);
      return CommonUtils.bytesToHex(hz);
    },
    encryptFromHex: function (gl, fk, dZ) {
      if (!fk || fk.length != 32) {
        fK.error("[SM4_ECB:encryptFromHex]fk empty fq length error!");
        return;
      }
      var gQ = CommonUtils.hexToBytes(gl);
      var fa = CommonUtils.hexToBytes(fk);
      var padding = arguments.length > 2 ? (arguments[2] == true) : true;
      var hz = this.encryptFromData(gQ, fa, padding);
      return CommonUtils.bytesToHex(hz);
    },
    encryptFromData: function (gQ, fa, dZ) {
      if (!fa || fa.length != 16) {
        fK.error("[SM4_ECB:encryptFromData]fa empty fq length error!");
        return;
      }
      var padding = arguments.length > 2 ? (arguments[2] == true) : true;
      try {
        var eO = new bL();
        var ed = new bH();
        ed.dZ = padding;
        ed.mode = eO.jw;
        eO.qu(ed, fa);
        var hz = eO.pv(ed, gQ);
        return hz;
      } catch (e) {
        fK.error(e);
        return null;
      }
    },
    decryptToText: function (dB, fk, dZ) {
      if (!fk || fk.length != 32) {
        fK.error("[SM4_ECB:decryptToText]fk empty fq length error!");
        return;
      }
      if (!dB || dB.length % 2 == 1) {
        fK.error("[SM4_ECB:decryptToText]dB empty fq length error!");
        return;
      }
      var fj = CommonUtils.hexToBytes(dB);
      var fa = CommonUtils.hexToBytes(fk);
      var padding = arguments.length > 2 ? (arguments[2] == true) : true;
      var gD = this.decryptToData(fj, fa, padding);
      return CommonUtils.bytesToString(gD);
    },
    decryptToHex: function (dB, fk, dZ) {
      if (!fk || fk.length != 32) {
        fK.error("[SM4_ECB:decryptToHex]fk empty fq length error!");
        return;
      }
      if (!dB || dB.length % 2 == 1) {
        fK.error("[SM4_ECB:decryptToHex]dB empty fq length error!");
        return;
      }
      var fj = CommonUtils.hexToBytes(dB);
      var fa = CommonUtils.hexToBytes(fk);
      var padding = arguments.length > 2 ? (arguments[2] == true) : true;
      var gD = this.decryptToData(fj, fa, padding);
      return CommonUtils.bytesToHex(gD);
    },
    decryptToData: function (fj, fa, dZ) {
      if (!fa || fa.length != 16) {
        fK.error("[SM4_ECB:decryptToData]fa empty fq length error!");
        return;
      }
      if (!fj || fj.length % 2 == 1) {
        fK.error("[SM4_ECB:decryptToData]fj empty fq length error!");
        return;
      }
      var padding = arguments.length > 2 ? (arguments[2] == true) : true;
      try {
        var eO = new bL();
        var ed = new bH();
        ed.dZ = padding;
        ed.mode = eO.ir;
        eO.rf(ed, fa);
        var gD = eO.pv(ed, fj);
        return gD;
      } catch (e) {
        fK.error(e);
        return null;
      }
    }
  },
  CBC: {
    encryptFromText: function (plainText, fk, dS, dZ) {
      if (!fk || fk.length != 32) {
        fK.error("[SM4_CBC:encryptFromText]fk empty fq length error!");
        return;
      }
      if (!dS || dS.length != 32) {
        fK.error("[SM4_CBC:encryptFromText]dS empty fq length error!");
        return;
      }
      var gQ = CommonUtils.stringToBytes(plainText);
      var fa = CommonUtils.hexToBytes(fk);
      var eG = CommonUtils.hexToBytes(fk);
      var padding = arguments.length > 3 ? (arguments[3] == true) : true;
      var hz = this.encryptFromData(gQ, fa, eG, padding);
      return CommonUtils.bytesToHex(hz);
    },
    encryptFromHex: function (gl, fk, dS, dZ) {
      if (!fk || fk.length != 32) {
        fK.error("[SM4_CBC:encryptFromHex]fk empty fq length error!");
        return;
      }
      if (!dS || dS.length != 32) {
        fK.error("[SM4_CBC:encryptFromHex]dS empty fq length error!");
        return;
      }
      var gQ = CommonUtils.hexToBytes(gl);
      var fa = CommonUtils.hexToBytes(fk);
      var eG = CommonUtils.hexToBytes(fk);
      var padding = arguments.length > 3 ? (arguments[3] == true) : true;
      var hz = this.encryptFromData(gQ, fa, eG, padding);
      return CommonUtils.bytesToHex(hz);
    },
    encryptFromData: function (gQ, fa, eG, dZ) {
      if (!fa || fa.length != 16) {
        fK.error("[SM4_CBC:encryptFromData]fa empty fq length error!");
        return;
      }
      if (!eG || eG.length != 16) {
        fK.error("[SM4_CBC:encryptFromData]eG empty fq length error!");
        return;
      }
      var padding = arguments.length > 3 ? (arguments[3] == true) : true;
      try {
        var eO = new bL();
        var ed = new bH();
        ed.dZ = padding;
        ed.mode = eO.jw;
        eO.qu(ed, fa);
        var hz = eO.rj(ed, eG, gQ);
        return hz;
      } catch (e) {
        fK.error(e);
        return null;
      }
    },
    decryptToText: function (dB, fk, dS, dZ) {
      if (!fk || fk.length != 32) {
        fK.error("[SM4_CBC:decryptToText]fk empty fq length error!");
        return;
      }
      if (!dS || dS.length != 32) {
        fK.error("[SM4_CBC:decryptToText]dS empty fq length error!");
        return;
      }
      if (!dB || dB.length % 2 == 1) {
        fK.error("[SM4_CBC:decryptToText]dB empty fq length error!");
        return;
      }
      var fj = CommonUtils.hexToBytes(dB);
      var fa = CommonUtils.hexToBytes(fk);
      var eG = CommonUtils.hexToBytes(fk);
      var padding = arguments.length > 3 ? (arguments[3] == true) : true;
      var gD = this.decryptToData(fj, fa, eG, padding);
      return CommonUtils.bytesToString(gD);
    },
    decryptToHex: function (dB, fk, dS, dZ) {
      if (!fk || fk.length != 32) {
        fK.error("[SM4_CBC:decryptToHex]fk empty fq length error!");
        return;
      }
      if (!dS || dS.length != 32) {
        fK.error("[SM4_CBC:decryptToHex]dS empty fq length error!");
        return;
      }
      if (!dB || dB.length % 2 == 1) {
        fK.error("[SM4_CBC:decryptToHex]dB empty fq length error!");
        return;
      }
      var fj = CommonUtils.hexToBytes(dB);
      var fa = CommonUtils.hexToBytes(fk);
      var eG = CommonUtils.hexToBytes(fk);
      var padding = arguments.length > 3 ? (arguments[3] == true) : true;
      var gD = this.decryptToData(fj, fa, eG, padding);
      return CommonUtils.bytesToHex(gD);
    },
    decryptToData: function (fj, fa, eG, dZ) {
      if (!fa || fa.length != 16) {
        fK.error("[SM4_CBC:decryptToData]fa empty fq length error!");
        return;
      }
      if (!eG || eG.length != 16) {
        fK.error("[SM4_CBC:decryptToData]eG empty fq length error!");
        return;
      }
      if (!fj || fj.length % 2 == 1) {
        fK.error("[SM4_CBC:decryptToData]fj empty fq length error!");
        return;
      }
      var padding = arguments.length > 3 ? (arguments[3] == true) : true;
      try {
        var eO = new bL();
        var ed = new bH();
        ed.dZ = padding;
        ed.mode = eO.ir;
        eO.rf(ed, fa);
        var gD = eO.rj(ed, eG, fj);
        return gD;
      } catch (e) {
        fK.error(e);
        return null;
      }
    }
  }
};
window.Sm2Utils = Sm2Utils;
window.Sm3Utils = Sm3Utils;
window.Sm4Utils = Sm4Utils;